/* vim: set filetype=c:
 *
 * pmm.h86  -  Definitions for accessing the Post Memory Manager
 *
 * Copyright (C) 2003-2007 Gero Kuhlmann <gero@gkminix.han.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: pmm.h86,v 1.7 2007/01/06 18:31:10 gkminix Exp $
 */

#ifndef SYSTEM_PMM_H86
#define SYSTEM_PMM_H86


/*
 * This file can only get included into target C or assembler source files.
 */
#define GCC_INCLUDE
#include <compiler.h>



/*
 * PMM services can be found by searching the BIOS rom area for the
 * string $PMM, which is at the beginning of the PMM structure.
 */
#define PMM_STARTSEG	0xE000		/* start segment to look for PMM */
#define PMM_SIGNATURE	0x4D4D5024	/* PMM structure signature */

#ifndef _ASSEMBLY_

struct bios_dpb {
  __long        signature;		/* PMM structure signature */
  __u8          revision;		/* structure revision */
  __u8          length;			/* structure length */
  __u8          checksum;		/* structure checksum */
  __far         entry;			/* PMM entry point */
} PACKED;

#else

			.struct	0
pmm_signature:		.struct	.+4	/* PMM structure signature */
pmm_revision:		.struct	.+1	/* structure revision */
pmm_length:		.struct	.+1	/* structure length */
pmm_checksum:		.struct	.+1	/* structure checksum */
pmm_entry:		.struct	.+4	/* PMM entry point */

#endif /* _ASSEMBLY_ */



/*
 * Post Memory Manager functions
 */
#define PMM_ALLOCATE	0		/* allocate memory block */
#define PMM_FIND	1		/* find memory block */
#define PMM_DEALLOCATE	2		/* deallocate memory block */

#endif

