Home | History | Annotate | Line # | Download | only in mkbootimage
pef.h revision 1.1.38.1
      1  1.1.38.1  uebayasi /*	$NetBSD: pef.h,v 1.1.38.1 2010/10/22 07:21:30 uebayasi Exp $	*/
      2       1.1   garbled 
      3       1.1   garbled /*-
      4       1.1   garbled  * Copyright (C) 1995-1997 Gary Thomas (gdt (at) linuxppc.org)
      5       1.1   garbled  * All rights reserved.
      6       1.1   garbled  *
      7       1.1   garbled  * Structure of a PEF format file
      8       1.1   garbled  *
      9       1.1   garbled  * Redistribution and use in source and binary forms, with or without
     10       1.1   garbled  * modification, are permitted provided that the following conditions
     11       1.1   garbled  * are met:
     12       1.1   garbled  * 1. Redistributions of source code must retain the above copyright
     13       1.1   garbled  *    notice, this list of conditions and the following disclaimer.
     14       1.1   garbled  * 2. Redistributions in binary form must reproduce the above copyright
     15       1.1   garbled  *    notice, this list of conditions and the following disclaimer in the
     16       1.1   garbled  *    documentation and/or other materials provided with the distribution.
     17       1.1   garbled  * 3. All advertising materials mentioning features or use of this software
     18       1.1   garbled  *    must display the following acknowledgement:
     19       1.1   garbled  *      This product includes software developed by Gary Thomas.
     20       1.1   garbled  * 4. The name of the author may not be used to endorse or promote products
     21       1.1   garbled  *    derived from this software without specific prior written permission.
     22       1.1   garbled  *
     23       1.1   garbled  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24       1.1   garbled  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     25       1.1   garbled  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     26       1.1   garbled  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     27       1.1   garbled  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     28       1.1   garbled  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     29       1.1   garbled  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     30       1.1   garbled  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     31       1.1   garbled  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     32       1.1   garbled  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     33       1.1   garbled  */
     34  1.1.38.1  uebayasi 
     35       1.1   garbled struct FileHeader
     36       1.1   garbled {
     37  1.1.38.1  uebayasi 	unsigned long magic;
     38  1.1.38.1  uebayasi 	unsigned long fileTypeID;
     39  1.1.38.1  uebayasi 	unsigned long archID;
     40  1.1.38.1  uebayasi 	unsigned long versionNumber;
     41  1.1.38.1  uebayasi 	unsigned long dateTimeStamp;
     42  1.1.38.1  uebayasi 	unsigned long definVersion;
     43  1.1.38.1  uebayasi 	unsigned long implVersion;
     44  1.1.38.1  uebayasi 	unsigned long currentVersion;
     45  1.1.38.1  uebayasi 	unsigned short numSections;
     46  1.1.38.1  uebayasi 	unsigned short loadableSections;
     47  1.1.38.1  uebayasi 	unsigned long memoryAddress;
     48       1.1   garbled };
     49       1.1   garbled 
     50       1.1   garbled #define PEF_MAGIC 0x4A6F7921  /* Joy! */
     51       1.1   garbled #define PEF_FILE  0x70656666  /* peff */
     52  1.1.38.1  uebayasi #define PEF_PPC   0x70777063  /* pwpc */
     53       1.1   garbled 
     54       1.1   garbled struct SectionHeader
     55       1.1   garbled {
     56  1.1.38.1  uebayasi 	unsigned long sectionName;
     57  1.1.38.1  uebayasi 	unsigned long sectionAddress;
     58  1.1.38.1  uebayasi 	unsigned long execSize;
     59  1.1.38.1  uebayasi 	unsigned long initSize;
     60  1.1.38.1  uebayasi 	unsigned long rawSize;
     61  1.1.38.1  uebayasi 	unsigned long fileOffset;
     62  1.1.38.1  uebayasi 	unsigned char regionKind;
     63  1.1.38.1  uebayasi 	unsigned char shareKind;
     64  1.1.38.1  uebayasi 	unsigned char alignment;
     65  1.1.38.1  uebayasi 	unsigned char _reserved;
     66       1.1   garbled };
     67       1.1   garbled 
     68       1.1   garbled #define CodeSection	0
     69       1.1   garbled #define DataSection	1
     70       1.1   garbled #define PIDataSection	2
     71       1.1   garbled #define ConstantSection	3
     72       1.1   garbled #define LoaderSection	4
     73       1.1   garbled 
     74       1.1   garbled #define NeverShare	0
     75       1.1   garbled #define ContextShare	1
     76       1.1   garbled #define TeamShare	2
     77       1.1   garbled #define TaskShare	3
     78  1.1.38.1  uebayasi #define GlobalShare	4
     79       1.1   garbled 
     80       1.1   garbled struct LoaderHeader
     81       1.1   garbled {
     82  1.1.38.1  uebayasi 	unsigned long entryPointSection;
     83  1.1.38.1  uebayasi 	unsigned long entryPointOffset;
     84  1.1.38.1  uebayasi 	unsigned long initPointSection;
     85  1.1.38.1  uebayasi 	unsigned long initPointOffset;
     86  1.1.38.1  uebayasi 	unsigned long termPointSection;
     87  1.1.38.1  uebayasi 	unsigned long termPointOffset;
     88  1.1.38.1  uebayasi 	unsigned long numImportFiles;
     89  1.1.38.1  uebayasi 	unsigned long numImportSyms;
     90  1.1.38.1  uebayasi 	unsigned long numSections;
     91  1.1.38.1  uebayasi 	unsigned long relocationsOffset;
     92  1.1.38.1  uebayasi 	unsigned long stringsOffset;
     93  1.1.38.1  uebayasi 	unsigned long hashSlotTable;
     94  1.1.38.1  uebayasi 	unsigned long hashSlotTableSize;
     95  1.1.38.1  uebayasi 	unsigned long numExportSyms;
     96       1.1   garbled };
     97