/[gxemul]/trunk/src/include/exec_ecoff.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/src/include/exec_ecoff.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (show annotations)
Mon Oct 8 16:18:00 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 5012 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.707 2005/04/27 16:37:33 debug Exp $
20050408	Some minor updates to the wdc. Linux now doesn't complain
		anymore if a disk is non-present.
20050409	Various minor fixes (a bintrans bug, and some other things).
		The wdc seems to work with Playstation2 emulation, but there
		is a _long_ annoying delay when disks are detected.
		Fixing a really important bintrans bug (when devices and RAM
		are mixed within 4KB pages), which was triggered with
		NetBSD/playstation2 kernels.
20050410	Adding a dummy dev_ps2_ether (just so that NetBSD doesn't
		complain as much during bootup).
		Symbols starting with '$' are now ignored.
		Renaming dev_ps2_ohci.c to dev_ohci.c, etc.
20050411	Moving the bintrans-cache-isolation check from cpu_mips.c to
		cpu_mips_coproc.c. (I thought this would give a speedup, but
		it's not noticable.)
		Better playstation2 sbus interrupt code.
		Skip ahead many ticks if the count register is read manually.
		(This increases the speed of delay-loops that simply read
		the count register.)
20050412	Updates to the playstation2 timer/interrupt code.
		Some other minor updates.
20050413	NetBSD/cobalt runs from a disk image :-) including userland;
		updating the documentation on how to install NetBSD/cobalt
		using NetBSD/pmax (!).
		Some minor bintrans updates (no real speed improvement) and
		other minor updates (playstation2 now uses the -o options).
20050414	Adding a dummy x86 (and AMD64) mode.
20050415	Adding some (32-bit and 16-bit) x86 instructions.
		Adding some initial support for non-SCSI, non-IDE floppy
		images. (The x86 mode can boot from these, more or less.)
		Moving the devices/ and include/ directories to src/devices/
		and src/include/, respectively.
20050416	Continuing on the x86 stuff. (Adding pc_bios.c and some simple
		support for software interrupts in 16-bit mode.)
20050417	Ripping out most of the x86 instruction decoding stuff, trying
		to rewrite it in a cleaner way.
		Disabling some of the least working CPU families in the
		configure script (sparc, x86, alpha, hppa), so that they are
		not enabled by default.
20050418	Trying to fix the bug which caused problems when turning on
		and off bintrans interactively, by flushing the bintrans cache
		whenever bintrans is manually (re)enabled.
20050419	Adding the 'lswi' ppc instruction.
		Minor updates to the x86 instruction decoding.
20050420	Renaming x86 register name indices from R_xx to X86_R_xx (this
		makes building on Tru64 nicer).
20050422	Adding a check for duplicate MIPS TLB entries on tlbwr/tlbwi.
20050427	Adding screenshots to guestoses.html.
		Some minor fixes and testing for the next release.

==============  RELEASE 0.3.2  ==============


1 /* gxemul: $Id: exec_ecoff.h,v 1.3 2005/03/05 12:34:02 debug Exp $ */
2 /* $NetBSD: exec_ecoff.h,v 1.12 2000/11/21 00:37:56 jdolecek Exp $ */
3
4 /*
5 * Copyright (c) 1994 Adam Glass
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Adam Glass.
19 * 4. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #ifndef _SYS_EXEC_ECOFF_H_
35 #define _SYS_EXEC_ECOFF_H_
36
37 /* #include <machine/ecoff_machdep.h> */
38 #include "exec_ecoff_mips.h"
39
40 struct ecoff_filehdr {
41 uint16_t f_magic; /* magic number */ /* u_short */
42 uint16_t f_nscns; /* # of sections */ /* u_short */
43 uint32_t f_timdat; /* time and date stamp */ /* u_int */
44 uint32_t f_symptr; /* file offset of symbol table */ /* u_long */
45 uint32_t f_nsyms; /* # of symbol table entries */ /* u_int */
46 uint16_t f_opthdr; /* sizeof the optional header */ /* u_short */
47 uint16_t f_flags; /* flags??? */ /* u_short */
48 };
49 /* original netbsd types ----^ */
50
51 struct ecoff_aouthdr {
52 u_short magic; /* u_short */
53 u_short vstamp; /* u_short */
54 ECOFF_PAD
55 uint32_t tsize; /* u_long */
56 uint32_t dsize; /* u_long */
57 uint32_t bsize; /* u_long */
58 uint32_t entry; /* u_long */
59 uint32_t text_start; /* u_long */
60 uint32_t data_start; /* u_long */
61 uint32_t bss_start; /* u_long */
62 ECOFF_MACHDEP;
63 };
64
65 struct ecoff_scnhdr { /* needed for size info */
66 char s_name[8]; /* name */
67 uint32_t s_paddr; /* physical addr? for ROMing?*/ /* u_long */
68 uint32_t s_vaddr; /* virtual addr? */ /* u_long */
69 uint32_t s_size; /* size */ /* u_long */
70 uint32_t s_scnptr; /* file offset of raw data */ /* u_long */
71 uint32_t s_relptr; /* file offset of reloc data */ /* u_long */
72 uint32_t s_lnnoptr; /* file offset of line data */ /* u_long */
73 uint16_t s_nreloc; /* # of relocation entries */ /* u_short */
74 uint16_t s_nlnno; /* # of line entries */ /* u_short */
75 uint32_t s_flags; /* flags */ /* u_int */
76 };
77
78 struct ecoff_exechdr {
79 struct ecoff_filehdr f;
80 struct ecoff_aouthdr a;
81 };
82
83 #define ECOFF_HDR_SIZE (sizeof(struct ecoff_exechdr))
84
85 #define ECOFF_OMAGIC 0407
86 #define ECOFF_NMAGIC 0410
87 #define ECOFF_ZMAGIC 0413
88
89 #define ECOFF_ROUND(value, by) \
90 (((value) + (by) - 1) & ~((by) - 1))
91
92 #define ECOFF_BLOCK_ALIGN(ep, value) \
93 ((ep)->a.magic == ECOFF_ZMAGIC ? ECOFF_ROUND((value), ECOFF_LDPGSZ) : \
94 (value))
95
96 #define ECOFF_TXTOFF(ep) \
97 ((ep)->a.magic == ECOFF_ZMAGIC ? 0 : \
98 ECOFF_ROUND(ECOFF_HDR_SIZE + (ep)->f.f_nscns * \
99 sizeof(struct ecoff_scnhdr), ECOFF_SEGMENT_ALIGNMENT(ep)))
100
101 #define ECOFF_DATOFF(ep) \
102 (ECOFF_BLOCK_ALIGN((ep), ECOFF_TXTOFF(ep) + (ep)->a.tsize))
103
104 #define ECOFF_SEGMENT_ALIGN(ep, value) \
105 (ECOFF_ROUND((value), ((ep)->a.magic == ECOFF_ZMAGIC ? ECOFF_LDPGSZ : \
106 ECOFF_SEGMENT_ALIGNMENT(ep))))
107
108 #ifdef _KERNEL
109 int exec_ecoff_makecmds __P((struct proc *, struct exec_package *));
110 int exec_ecoff_setup_stack __P((struct proc *, struct exec_package *));
111 int cpu_exec_ecoff_probe __P((struct proc *, struct exec_package *));
112 void cpu_exec_ecoff_setregs __P((struct proc *, struct exec_package *,
113 u_long));
114
115 int exec_ecoff_prep_omagic __P((struct proc *, struct exec_package *,
116 struct ecoff_exechdr *, struct vnode *));
117 int exec_ecoff_prep_nmagic __P((struct proc *, struct exec_package *,
118 struct ecoff_exechdr *, struct vnode *));
119 int exec_ecoff_prep_zmagic __P((struct proc *, struct exec_package *,
120 struct ecoff_exechdr *, struct vnode *));
121
122 #endif /* _KERNEL */
123 #endif /* !_SYS_EXEC_ECOFF_H_ */

  ViewVC Help
Powered by ViewVC 1.1.26