xref: /netbsd/sys/arch/hppa/include/exec.h (revision c4a72b64)
1 /*	$NetBSD: exec.h,v 1.1 2002/06/05 01:04:21 fredette Exp $	*/
2 
3 /*	$OpenBSD: exec.h,v 1.6 2001/01/22 14:51:03 art Exp $	*/
4 
5 /*
6  * Copyright (c) 1994, The University of Utah and
7  * the Computer Systems Laboratory at the University of Utah (CSL).
8  * All rights reserved.
9  *
10  * Permission to use, copy, modify and distribute this software is hereby
11  * granted provided that (1) source code retains these copyright, permission,
12  * and disclaimer notices, and (2) redistributions including binaries
13  * reproduce the notices in supporting documentation, and (3) all advertising
14  * materials mentioning features or use of this software display the following
15  * acknowledgement: ``This product includes software developed by the
16  * Computer Systems Laboratory at the University of Utah.''
17  *
18  * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
19  * IS" CONDITION.  THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
20  * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21  *
22  * CSL requests users of this software to return to csl-dist@cs.utah.edu any
23  * improvements that they make and grant CSL redistribution rights.
24  *
25  * 	Utah $Hdr: exec.h 1.3 94/12/16$
26  */
27 
28 #ifndef	_HPPA_EXEC_H_
29 #define	_HPPA_EXEC_H_
30 
31 #define cpu_exec_aout_makecmds(p, epp)  ENOEXEC
32 
33 /* Size of a page in an object file. */
34 #define	__LDPGSZ	4096
35 
36 #define ARCH_ELFSIZE		32
37 
38 #define ELF_TARG_CLASS          ELFCLASS32
39 #define ELF_TARG_DATA           ELFDATA2MSB
40 #define ELF_TARG_MACH           EM_PARISC
41 
42 /* #define _NLIST_DO_AOUT */
43 /* #define _NLIST_DO_ECOFF */
44 #define _NLIST_DO_ELF
45 #define _NLIST_DO_SOM
46 
47 /* #define	_KERN_DO_AOUT */
48 /* #define	_KERN_DO_ECOFF */
49 #define	_KERN_DO_ELF
50 #define	_KERN_DO_SOM
51 
52 /*
53  * the following MD ELF values defenitions are from the:
54  * "Processor-Specific ELF Supplement for PA-RISC.
55  *  Including HP and HP-UX Extensions. Version 1.43. October 6, 1998"
56  *	http://www.software.hp.com/STK/partner/elf-pa.pdf
57  *
58  */
59 
60 /* parisc-specific elf flags */
61 #define	EF_PARISC_TRAPNIL	0x00010000	/* trap on NULL derefs */
62 #define	EF_PARISC_EXT		0x00020000	/* program uses arch exts */
63 #define	EF_PARISC_LSB		0x00040000	/* program expects LSB mode */
64 #define	EF_PARISC_WIDE		0x00080000	/* program expects wide mode */
65 #define	EF_PARISC_NO_KABP	0x00100000	/* don't allow kernel assisted
66 						   branch prediction */
67 #define	EF_PARISC_LAZYSWAP	0x00200000	/* allow lazy swap allocation
68 						   for dynamically allocated
69 						   program segments */
70 #define	EF_PARISC_ARCH		0x0000ffff	/* architecture version */
71 #define		EFA_PARISC_1_0	0x020B
72 #define		EFA_PARISC_1_1	0x0210
73 #define		EFA_PARISC_2_0	0x0214
74 
75 /* legend: 0 - pa7000, 1 - pa7100, 2 - pa7200, 3 - pa7100LC, 4 - pa8000 */
76 #define	PARISC_AE_QWSI	0x00000001	/* 0  : enable quadword stores */
77 #define	PARISC_AE_FPLSU	0x00000002	/*   1: fp load/store to I/O space */
78 #define	PARISC_AE_RSQRT	0x00000004	/* 0  : reciprocal sqrt */
79 #define	PARISC_AE_FDCG	0x00000008	/* 0,1: fdc includes graph flushes */
80 #define	PARISC_AE_HPAR	0x00000010	/* 3,4: half-word add/sub/av */
81 #define	PARISC_AE_BSW	0x00000020	/* 3,4: half-word shift-add */
82 #define	PARISC_AE_HPSA	0x00000040	/* 3  : byte-swapping stores */
83 #define	PARISC_AE_DPR0	0x00000080	/* 2,4: data prefetch via ld to r0 */
84 
85 #define	SHN_PARISC_ANSI_COMMON	0xff00
86 #define	SHN_PARISC_HUGE_COMMON	0xff01
87 
88 /* sh_type */
89 #define	SHT_PARISC_EXT		0x70000000	/* contains product-specific
90 						   extension bits */
91 #define	SHT_PARISC_UNWIND	0x70000001	/* contains unwind table enries
92 						   sh_info contains index of
93 						   the code section to which
94 						   unwind entries apply */
95 #define	SHT_PARISC_DOC		0x70000002	/* contains debug info for -O */
96 #define	SHT_PARISC_ANNOT	0x70000003	/* contains code annotations */
97 
98 /* sh_flags */
99 #define	SHF_PARISC_SBP	0x80000000	/* contains code compiled for
100 					   static branch prediction */
101 #define	SHF_PARISC_HUGE	0x40000000	/* should be allocated far from gp */
102 #define	SHF_PARISC_SHORT 0x20000000	/* should be allocated near from gp */
103 
104 #define	ELF_PARISC_ARCHEXT	".PARISC.archext"
105 #define	ELF_PARISC_MILLI	".PARISC.milli"
106 #define	ELF_PARISC_UNWIND	".PARISC.unwind"
107 #define	ELF_PARISC_UNWIND_INFO	".PARISC.unwind_info"
108 #define	ELF_PARISC_SDATA	".sdata"
109 #define	ELF_PARISC_NOBITS	".sbss"
110 
111 #define	STT_PARISC_MILLI	13	/* entry point of a millicode routine */
112 
113 #define	PT_PARISC_ARCHEXT	0x70000000	/* segment contains
114 						   .PARISC.archext section */
115 #define	PT_PARISC_UNWIND	0x70000001	/* segment contains
116 						   .unwind section */
117 
118 #define	PF_PARISC_SBP		0x08000000	/* segment contains code
119 					compiled for static branch prediction */
120 
121 #endif	/* _HPPA_EXEC_H_ */
122