#ifndef LIBRARIES_CONFIGREGS_H
#define LIBRARIES_CONFIGREGS_H
/*
**	$Filename: libraries/configregs.h $
**	$Release: 1.3 $
**
**	register and bit definitions for expansion boards 
**
**	(C) Copyright 1986,1987,1988 Commodore-Amiga, Inc.
**	    All Rights Reserved
*/

#ifndef EXEC_TYPES_H
#include "exec/types.h"
#endif	!EXEC_TYPES_H

/*
** Expansion boards are actually organized such that only one nibble per
** word (16 bits) are valid information.  This table is structured
** as LOGICAL information.  This means that it never corresponds
** exactly with a physical implementation.
**
** The expansion space is logically split into two regions:
** a rom portion and a control portion.	 The rom portion is
** actually stored in one's complement form (except for the
** er_type field).
*/


struct ExpansionRom {
    UBYTE	er_Type;
    UBYTE	er_Product;
    UBYTE	er_Flags;
    UBYTE	er_Reserved03;
    UWORD	er_Manufacturer;
    ULONG	er_SerialNumber;
    UWORD	er_InitDiagVec;
    UBYTE	er_Reserved0c;
    UBYTE	er_Reserved0d;
    UBYTE	er_Reserved0e;
    UBYTE	er_Reserved0f;
};

struct ExpansionControl {
    UBYTE	ec_Interrupt;		/* interrupt control register */
    UBYTE	ec_Reserved11;
    UBYTE	ec_BaseAddress;		/* set new config address */
    UBYTE	ec_Shutup;		/* don't respond, pass config out */
    UBYTE	ec_Reserved14;
    UBYTE	ec_Reserved15;
    UBYTE	ec_Reserved16;
    UBYTE	ec_Reserved17;
    UBYTE	ec_Reserved18;
    UBYTE	ec_Reserved19;
    UBYTE	ec_Reserved1a;
    UBYTE	ec_Reserved1b;
    UBYTE	ec_Reserved1c;
    UBYTE	ec_Reserved1d;
    UBYTE	ec_Reserved1e;
    UBYTE	ec_Reserved1f;
};

/*
** many of the constants below consist of a triplet of equivalent
** definitions: xxMASK is a bit mask of those bits that matter.
** xxBIT is the starting bit number of the field.  xxSIZE is the
** number of bits that make up the definition.	This method is
** used when the field is larger than one bit.
**
** If the field is only one bit wide then the xxB_xx and xxF_xx convention
** is used (xxB_xx is the bit number, and xxF_xx is mask of the bit).
*/

/* manifest constants */
#define E_SLOTSIZE		0x10000
#define E_SLOTMASK		0xffff
#define E_SLOTSHIFT		16

/* these define the two free regions of Zorro memory space.
** THESE MAY WELL CHANGE FOR FUTURE PRODUCTS!
*/
#define E_EXPANSIONBASE		0xe80000
#define E_EXPANSIONSIZE		0x080000
#define E_EXPANSIONSLOTS	8

#define E_MEMORYBASE		0x200000
#define E_MEMORYSIZE		0x800;
extern char *ecvt __ARGS((double, int, int *, int *));
extern void main __ARGS((int, char **));
extern void _main __ARGS((char *));
extern void _tinymain __ARGS((char *));
extern void exit __ARGS((int));
extern void _exit __ARGS((int));
extern void XCEXIT __ARGS((long));
extern char *fcvt __ARGS((double, int, int *, int *));
extern char *getenv __ARGS((char *));
extern char *gcvt __ARGS((double, int, char *));
extern int getfnl __ARGS((char *, char *, unsigned, int));
extern int iabs __ARGS((int));
extern long labs __ARGS((long));
extern int onexit __ARGS((int(*)()));
extern int putenv __ARGS((char *));
/*
* define NULL if it's not already defined
*
*/
#ifndef NULL
#define NULL 0L
#endif
exter     å sinh __ARGS((double));
extern double sqrt __ARGS((double));
extern void srand __ARGS((unsigned));
extern void srand48 __ARGS((long));
extern double tan __ARGS((double));
extern double tanh __ARGS((double));

/**
*
* Macros
*
*/

#ifndef abs
#define abs(x) ((x)<0?-(x):(x))
#endif
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<=(b)?(a):(b))
#endif
#endifGS((cha     ãˆ));
extern long _dcreatx __ARGS((char *, int));
extern int dfind __ARGS((struct FILEINFO *, char *, int));
extern int dnext __ARGS((struct FILEINFO *));
extern long _dopen __ARGS((char *, int));
extern unsigned _dread __ARGS((long, char *, unsigned));
extern long _dseek __ARGS((long, long, int));
extern unsigned _dwrite __ARGS((long, char *, unsigned));
extern int getcd __ARGS((int,char *));
extern int getdfs __ARGS((char *, struct DISKINFO *));
extern int getfa __ARGS((char *));
extern long getft __ARGS((char *));
extern int getpath __ARGS((BPTR, char *));
extern BPTR findpath __ARGS((char *));
/**
*
* Miscellaneous external definitions
*
*/
extern int datecmp __ARGS((long[], long[]));
extern int chgclk __ARGS((unsigned char *));
extern void getclk __ARGS((unsigned char *));
extern int onbreak __ARGS((int __ARGS((*)) __ARGS(())));
extern int poserr __ARGS((char *));
extern int chkabort __ARGS((void));
extern int Chk_Abort __ARGS((void));
struct DeviceList *getasn __ARGS((char *));

#define geta4 __builtin_geta4
extern void geta4 __ARGS((void));

#define getreg __builtin_getreg
extern long getreg __ARGS((int));

#define putreg __builtin_putreg
extern void putreg __ARGS((int, long));

#define __emit __builtin_emit
extern void __emit __ARGS((int));

#define REG_D0 0
#define REG_D1 1
#define REG_D2 2
#define REG_D3 3
#define REG_D4 4
#define REG_D5 5
#define REG_D6 6
#define REG_D7 7
#define REG_A0 8
#define REG_A1 9
#define REG_A2 10
#define REG_A3 11
#define REG_A4 12
#define REG_A5 13
#define REG_A6 14
#define REG_A7 15

#endif
     =     Ýhx(d2c(c2d(import(offset(taskbase,156),4))*4,4))
cos       = "$"||c2x(d2c(c2d(import(offset(taskbase,160),4))*4,4))
'd' '"CurrentDir ' curdir ' CIS        ' cis ' COS     ' cos '"'

contask   = "$"||c2x(import(offset(taskbase,164),4))
filesys   = "$"||c2x(import(offset(taskbase,168),4))
cli       = "$"||c2x(d2c(c2d(import(offset(taskbase,172),4))*4,4))
'd' '"ConsoleTask' contask ' FileSysTask' filesys ' CLI     ' cli '"'

retaddr   = "$"||c2x(import(offset(taskbase,180),4))
pktwait   = "$"||c2x(import(offset(taskbase,184),4))
'd' '"ReturnAddr ' retaddr ' PktWait    ' pktwait '"'
end

exit 0

/* Locate a task in the system based upon the name */
findtask:
  parse arg name
  execbase = import("00000004"x,4)
  liboff = 420
  nodebase = import(offset(execbase, liboff), 4)

do while(import(nodebase,4) ~= NULL)
   if import(import(offset(nodebase,10),4)) = name then return nodebase
   nodebase = import(nodebase,4)
end

  liboff = 406
  nodebase = import(offset(execbase, liboff), 4)

do while(import(nodebase,4) ~= NULL)
   if import(import(offset(nodebase,10),4)) = name then return nodebase
   nodebase = import(nodebase,4)
end

'd' '"Could not find process' name||'"'
exit(0)
led */     Ø¸(port = FindPort(PORTNAME)) == NULL)
      {
      stay = 1; /* remember to hang around when we are done */
      /* not installed, we need to install our own port */
      if ((port = CreatePort(PORTNAME,0)) == NULL)
         goto abort;
      }

   /* now send the parameter to the waiting program */
   if ((msg = (struct OURMSG *)
              AllocMem(sizeof(struct OURMSG), MEMF_CLEAR|MEMF_PUBLIC)) == NULL)
      goto abort;

   /* fill in the message information */
   msg->msgpart.mn_Length = sizeof(struct OURMSG);

   strcpy(cmdstr, DEFCMD);

   /* if we were run from CLI then output our banner and process parameters */
   if (cmd && *cmd)
      {
      /* display our copyright */
      if (stay && _Backstdout)
         Write(_Backstdout, BANNER, sizeof(BANNER));

      /* skip over any leading spaces i