pcfilep.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PCFILEP_H
#define _PCFILEP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_DOSMOUNT_RETRIES 3
#define SECSIZ 512
/*
* Access permissions for dosAccess(), dosOpen()
* NOTE: These permission need to match those for the DOS compiler.
*/
#define FILE_EXISTS 1
#define FILE_READ 0x0000
#define FILE_WRITE 0x0001
#define FILE_RDWR 0x0002
#define FILE_APPEND 0x0008
#define FILE_CREATE 0x0100
#define FILE_TRUNC 0x0200
/* active partition */
#define TYPE_SOLARIS 0x82
/* the fdisk starts. */
#pragma pack(1)
struct _fdisk_partition_ {
union {
long fd_start_sec_long;
struct {
} s;
} u;
long fd_part_len;
};
#define fd_start_sec u.fd_start_sec_long
#define fd_partition fd_type
#pragma pack()
#pragma pack(1)
struct _boot_sector_ {
/*
* Byte offset at this point is 28 so we can declare the next
* variable with the correct type and not worry about alignment.
*/
long bs_hidden_sectors;
long bs_lsiv; /* ... logical sectors in volume */
char bs_volume_id[4];
char bs_volume_label[11];
char bs_type[8];
/* ---- ADDED BY SUNSOFT FOR MDBOOT ---- */
};
#pragma pack()
/*
* Cluster types
*/
#define CLUSTER_AVAIL 0x00
#define CLUSTER_EOF CLUSTER_EOF_16_0
/*
* Cluster operations for allocation
*/
/*
* This structure is filled in by initFAT()
*/
struct _fat_controller_ {
union {
} fu;
long f_adjust; /* starting sec for part. */
long f_rootsec; /* root dir starting sec. */
long f_rootlen; /* length of root in sectors */
long f_filesec; /* adjustment for clusters */
long f_dclust; /* cur dir cluster */
int f_nxtfree; /* next free cluster */
int f_ncluster; /* number of cluster in part */
};
#define NAMESIZ 8
#define EXTSIZ 3
#pragma pack(1)
struct _dir_entry_ {
char d_res[10];
short d_time;
short d_date;
long d_size;
};
#pragma pack()
/*
* Number of entries in one sector
*/
/*
* Directory entry attributes
*/
#define DE_READONLY 0x01
#define DE_HIDDEN 0x02
#define DE_SYSTEM 0x04
#define DE_LABEL 0x08
#define DE_DIRECTORY 0x10
#define DE_ARCHIVE 0x20
#define DE_RESERVED1 0x40
#define DE_RESERVED2 0x80
struct _file_descriptor_ {
int f_desc; /* descriptor number */
long f_startclust; /* starting cluster number */
long f_off; /* current offset */
long f_len; /* size of file */
long f_index; /* index into directory block */
int f_volidx; /* Volume device index */
char *f_volname; /* Name of volume */
};
#ifdef __cplusplus
}
#endif
#endif /* _PCFILEP_H */