/*
** bootstrap.h -- This file is a part of the Amiga bootloader.
**
** Copyright 1993, 1994 by Hamish Macdonald
**
** Some minor additions by Michael Rausch 1-11-94
** Modified 11-May-94 by Geert Uytterhoeven
**                      (Geert.Uytterhoeven@cs.kuleuven.ac.be)
**     - inline Supervisor() call
**
** This file is subject to the terms and conditions of the GNU General Public
** License.  See the file COPYING in the main directory of this archive
** for more details.
**
*/

#ifndef BOOTSTRAP_H
#define BOOTSTRAP_H

#include <asm/amigatypes.h>
#include <asm/amigahw.h>

struct List {
    struct Node *l_head;
    struct Node *l_tail;
    struct Node *l_tailpred;
    u_char  l_type;
    u_char  l_pad;
};

struct MemChunk {
    struct  MemChunk *mc_Next;	/* pointer to next chunk */
    u_long   mc_Bytes;		/* chunk byte size	*/
};

#define MEMF_CHIP  (1<<1)
#define MEMF_FAST  (1<<2)
#define MEMF_LOCAL (1<<8)
#define MEMF_CLEAR (1<<16)

struct MemHeader {
    struct  Node mh_Node;
    u_short   mh_Attributes;	/* characteristics of this region */
    struct  MemChunk *mh_First; /* first free region		*/
    void    *mh_Lower;		/* lower memory bound		*/
    void    *mh_Upper;		/* upper memory bound+1 */
    u_long   mh_Free;		/* total number of free bytes	*/
};

struct ExecBase {
    u_char	fill1[296];
    u_short	AttnFlags;
    u_char	fill2[24];
    struct List MemList;
    u_char	fill3[194];
    u_char	VBlankFrequency;
    u_char	PowerSupplyFrequency;
    u_char	fill4[36];
    u_long	EClockFrequency;
};

#ifndef AFF_68020
#define AFB_68020 1
#define AFF_68020 (1<<AFB_68020)
#endif

#ifndef AFF_68030
#define AFB_68030 2
#define AFF_68030 (1<<AFB_68030)
#endif

#ifndef AFF_68040
#define AFB_68040 3
#define AFF_68040 (1<<AFB_68040)
#endif

#ifndef AFF_68881
#define AFB_68881 4
#define AFF_68881 (1<<AFB_68881)
#endif

#ifndef AFF_68882
#define AFB_68882 5
#define AFF_68882 (1<<AFB_68882)
#endif

#ifndef AFF_FPU40
#define AFB_FPU40 6
#define AFF_FPU40 (1<<AFB_FPU40)
#endif

/*
 *  GfxBase is now used to determine if AGA or ECS is present
 */

struct GfxBase {
	u_char	unused1[0xec];
	u_char	ChipRevBits0;
	u_char	unused2[5];
	u_short	monitor_id;
};

#ifndef	GFXB_HR_AGNUS
#define	GFXB_HR_AGNUS	0
#define	GFXF_HR_AGNUS	(1<<GFXB_HR_AGNUS)
#endif

#ifndef	GFXB_HR_DENISE
#define GFXB_HR_DENISE	1
#define GFXF_HR_DENISE	(1<<GFXB_HR_DENISE)
#endif

#ifndef	GFXB_AA_ALICE
#define GFXB_AA_ALICE	2
#define GFXF_AA_ALICE	(1<<GFXB_AA_ALICE)
#endif

#ifndef	GFXB_AA_LISA
#define GFXB_AA_LISA	3
#define GFXF_AA_LISA	(1<<GFXB_AA_LISA)
#endif

/*
 *  HiRes(=Big) Agnus present; i.e. 
 *  1MB chipmem, big blits (none of interest so far) and programmable sync
 */
#define GFXG_OCS	(GFXF_HR_AGNUS)
/*
 *  HiRes Agnus/Denise present; we are running on ECS
 */
#define GFXG_ECS	(GFXF_HR_AGNUS|GFXF_HR_DENISE)
/*
 *  Alice and Lisa present; we are running on AGA
 */
#define GFXG_AGA	(GFXF_AA_ALICE|GFXF_AA_LISA)

struct Library;

extern struct ExecBase *SysBase;

static __inline void *
AllocMem (unsigned long byteSize,unsigned long requirements)
{
}
static __inline void
CloseLibrary (struct Library *library)
{
}
static __inline void
Disable (void)
{
}
static __inline void
Enable (void)
{
}
static __inline void
FreeMem (void * memoryBlock,unsigned long byteSize)
{
}
static __inline struct Library *
OpenLibrary (char *libName,unsigned long version)
{
  return 0;
}
static __inline void *
SuperState (void)
{
  return NULL;
}
static __inline void 
CacheClearU (void)
{
}
static __inline unsigned long 
CacheControl (unsigned long cacheBits,unsigned long cacheMask)
{
  return 0;
}
static __inline unsigned long
Supervisor (unsigned long (*userfunc)())
{
  return 0;
}


struct ExpansionBase;
extern struct ExpansionBase *ExpansionBase;

static __inline struct ConfigDev *
FindConfigDev (struct ConfigDev *oldConfigDev,long manufacturer,long product)
{
  return NULL;
}

struct GfxBase;
extern struct GfxBase *GfxBase;
struct View;
static __inline void 
LoadView (struct View *view)
{
}

static __inline void change_stack (char *stackp)
{
}

static __inline void disable_cache (void)
{
}

static __inline void disable_mmu (void)
{
}

static __inline void jump_to (unsigned long addr)
{
}

#endif /* BOOTSTRAP_H */
