/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2003 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) 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.
*/
#ifndef _PC_SLICE_H
#define _PC_SLICE_H
/*
* These define the basic PC MBR sector characteristics
*/
#define PC_MBR_SECTOR 0
/*
* Defines to guarantee structural alignment.
*/
( *( (unsigned short *) (((int) mbr_ptr) + PC_MBR_SIG_OFFSET) ) \
== PC_MBR_SIGNATURE )
( *( (unsigned short *) (((int) mbr_ptr) + PC_MBR_SIG_OFFSET) ) )
( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET \
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
/*
* PC flag types are defined here.
*/
#define PC_SLICE_FLAG_NONE 0
/*
* Known PC partition types are defined here.
*/
/* This is not a flag actually, but used as if it were a flag. */
#define PC_SLICE_TYPE_NONE 0
/* For convinience. */
/* Check if TYPE is a FAT partition type. Clear the hidden flag before
the check, to allow the user to mount a hidden partition in GRUB. */
_type == PC_SLICE_TYPE_FAT12 \
|| _type == PC_SLICE_TYPE_FAT16_LT32M \
|| _type == PC_SLICE_TYPE_FAT16_GT32M \
|| _type == PC_SLICE_TYPE_FAT16_LBA \
|| _type == PC_SLICE_TYPE_FAT32 \
|| _type == PC_SLICE_TYPE_FAT32_LBA \
|| type == PC_SLICE_TYPE_SOLARIS_BOOT \
|| type == PC_SLICE_TYPE_DELL_UTIL; })
(((type) == PC_SLICE_TYPE_EXTENDED) \
|| ((type) == PC_SLICE_TYPE_WIN95_EXTENDED) \
|| ((type) == PC_SLICE_TYPE_LINUX_EXTENDED))
(((type) == PC_SLICE_TYPE_MINIX) \
|| ((type) == PC_SLICE_TYPE_LINUX_MINIX))
/* these ones are special, as they use their own partitioning scheme
to subdivide the PC partitions from there. */
/* For convenience. */
/*
* *BSD-style disklabel & partition definitions.
*
* This is a subdivided slice of type 'PC_SLICE_TYPE_BSD', so all of
* these, except where noted, are relative to the slice in question.
*/
#define BSD_LABEL_MAG_OFFSET 0
/*
* Defines to guarantee structural alignment.
*/
( *( (unsigned long *) (((int) l_ptr) + BSD_LABEL_MAG_OFFSET) ) \
== ( (unsigned long) BSD_LABEL_MAGIC ) )
( *( (unsigned long *) (((int) l_ptr) + BSD_LABEL_MAG_OFFSET) ) )
( *( (unsigned short *) (((int) l_ptr) + BSD_LABEL_NPARTS_OFFSET) ) )
( *( (unsigned long *) (((int) l_ptr) + BSD_PART_OFFSET \
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
+ (part << 4)) ) )
/* possible values for the "DISKTYPE"... all essentially irrelevant
except for DTYPE_SCSI */
/* possible values for the *BSD-style partition type */
/*
* Solaris LABEL definitions. All definitions are relative to the
* current PC_SLICE.
*/
(*((unsigned short *) (((int) l_ptr) + SOL_LABEL_MAGIC_OFFSET)) \
== ((unsigned short) SOL_LABEL_MAGIC ))
#endif /* _PC_SLICE_H */