DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ T e

⟦571078009⟧ TextFile

    Length: 2502 (0x9c6)
    Types: TextFile
    Notes: @(#)exec.h 13.2 (RC International) 91/04/30 */
    Names: »exec.h«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/include/sys/exec.h« 

TextFile

/*	@(#)exec.h	13.2 (RC International) 91/04/30	*/

#ifndef _EXEC_H
#define _EXEC_H

#include <filehdr.h>

#include <aouthdr.h>

#include <scnhdr.h>

struct exec {
	struct filehdr	ex_f;
	struct aouthdr	ex_o;
};

/*
 * Coff files produced by the mips loader are guaranteed to have the raw data
 * for the sections follow the headers in this order: .text, .rdata, .data and
 * .sdata the sum of the sizes of last three is the value in dsize in the
 * optional header.  This is all done for the benefit of the programs that
 * have to load these objects so only the file header and optional header
 * have to be inspected.  The macro N_TXTOFF() takes pointers to file header
 * and optional header and returns the file offset to the start of the raw
 * data for the .text section.  The raw data for the three data sections
 * follows the start of the .text section by the value of tsize in the optional
 * header.
 */
#define	FILHDR	struct filehdr
#define	FILHSZ	sizeof(FILHDR)

#ifndef AOUTHSZ
#define	AOUTHSZ	sizeof(struct aouthdr)
#endif

#ifndef SCNHSZ
#define	SCNHSZ	sizeof(struct scnhdr)
#endif
/* SCNROUND is the size that sections are rounded off to */
#define SCNROUND ((long)16)

#define N_TXTOFF(f, a) \
 ((a).magic == ZMAGIC ? 0 : \
  ((a).vstamp < 23 ? \
   ((FILHSZ + AOUTHSZ + (f).f_nscns * SCNHSZ + 7) & 0xfffffff8) : \
   ((FILHSZ + AOUTHSZ + (f).f_nscns * SCNHSZ + SCNROUND-1) & ~(SCNROUND-1)) ) )

/*
 * for vax compatibility
 */
#define a_data	ex_o.dsize
#define a_text	ex_o.tsize
#define a_bss	ex_o.bsize
#define a_entry	ex_o.entry
#define a_magic	ex_o.magic

#ifdef LANGUAGE_C
#define  MIPSEBMAGIC	0x0160
#define  MIPSELMAGIC	0x0162
#endif LANGUAGE_C
#ifdef LANGUAGE_PASCAL
#define  MIPSEBMAGIC	16#0160
#define  MIPSELMAGIC	16#0162
#endif LANGUAGE_PASCAL

#ifdef MIPSEL
#define OBJMAGIC	MIPSELMAGIC
#endif
#ifdef MIPSEB
#define OBJMAGIC	MIPSEBMAGIC
#endif

#define AMAGIC  0401		/* output of assembler */

#ifndef OMAGIC
#define	OMAGIC	0407		/* old impure format */
#endif

#ifndef NMAGIC
#define	NMAGIC	0410		/* read-only text */
#endif

#ifndef ZMAGIC
#define	ZMAGIC	0413		/* demand load format */
#endif

#define	LIBMAGIC	0443
#define	N_BADMAG(x) \
    (((x).magic)!=OMAGIC && ((x).magic)!=NMAGIC && ((x).magic)!=ZMAGIC && \
     ((x).magic)!=LIBMAGIC)

/*
 * Macros to verify correct byte order for executables
 */
#ifdef MIPSEB
#define	N_BADBO(fh)	((fh).f_magic != MIPSEBMAGIC)
#endif

#ifdef MIPSEL
#define	N_BADBO(fh)	((fh).f_magic != MIPSELMAGIC)
#endif

#endif /* _EXEC_H */