/*
 * $Header: /smsa/bsd:include/dev/partition.h:bsd  1.4  $
 * $Source: /smsa/bsd:include/dev/partition.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 *
 *	This is the format of the (now variable) partition table
 *	which is set up by the disc formatter.
 */

#ifndef __dev_partition_h
#define __dev_partition_h

struct	partition_table	{
	unsigned	part_magic;		/*  Magic number  */
	struct	{
		unsigned  long	part_start;	/*  Abs cylinder number  */
		unsigned  long	part_size;	/*  No of cyls  */
		unsigned  int	part_flags;	/*  Status  */
		char	part_desc[16];		/*  Descriptive text  */
	}  part_tab[8];
};

#define	PART_MAGIC	0x70617274

/*
 *	Standard partition numbers.
 */

#define	PART_ROOT	0
#define	PART_SWAP	1
#define	PART_BOOT	6
#define	PART_ALL	7

/*
 *	Status flags
 */

#define	PART_STAT_CHANGE	0x80000000	/*  Has been changed  */
#define	PART_STAT_NUNIX		0x40000000	/*  UNIX not allowed  */
#define	PART_STAT_NARTHUR	0x20000000	/*  Arthur not allowed  */

/*
 *	Location of word giving ADFS partition size in cylinders.
 */

#define	ADFS_GEOM_SECTOR	0xC00

struct	adfs_geom_sector	{
	char		spare1[0x1B8];
	unsigned  short	lowcurrentcyl;
	unsigned  short	precompcyl;
	unsigned  long	parkaddress;
	unsigned  char	l2_secsize;
	unsigned  char	secspertrack;
	unsigned  char	heads;
	char		spare2[0x1D0-0x1C3];
	long		discsize;
	char		spare3[0x1FC-0x1D4];
	long		adfs_part_size_loc;
};

#define	ADFS_PART_CYLS(X)	(((X) >> 8) & 0x0000ffff)
#define	ADFS_PART_FMT(X)	((X) & 0x0000000f)

/*
 *	This format (type 1).
 */

#define	ADFS_PART_FMT_TYPE1	1

/*
 *	Error codes ORed into return code.
 */

#define	PART_FORMAT_ERROR	1
#define	PART_OVERLAP_ERROR	2

#endif/*__dev_partition_h*/

/* EOF partition.h */
