efs_vh.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * efs_vh.h
  4. *
  5. * Copyright (c) 1999 Al Smith
  6. *
  7. * Portions derived from IRIX header files (c) 1985 MIPS Computer Systems, Inc.
  8. */
  9. #ifndef __EFS_VH_H__
  10. #define __EFS_VH_H__
  11. #define VHMAGIC 0xbe5a941 /* volume header magic number */
  12. #define NPARTAB 16 /* 16 unix partitions */
  13. #define NVDIR 15 /* max of 15 directory entries */
  14. #define BFNAMESIZE 16 /* max 16 chars in boot file name */
  15. #define VDNAMESIZE 8
  16. struct volume_directory {
  17. char vd_name[VDNAMESIZE]; /* name */
  18. __be32 vd_lbn; /* logical block number */
  19. __be32 vd_nbytes; /* file length in bytes */
  20. };
  21. struct partition_table { /* one per logical partition */
  22. __be32 pt_nblks; /* # of logical blks in partition */
  23. __be32 pt_firstlbn; /* first lbn of partition */
  24. __be32 pt_type; /* use of partition */
  25. };
  26. struct volume_header {
  27. __be32 vh_magic; /* identifies volume header */
  28. __be16 vh_rootpt; /* root partition number */
  29. __be16 vh_swappt; /* swap partition number */
  30. char vh_bootfile[BFNAMESIZE]; /* name of file to boot */
  31. char pad[48]; /* device param space */
  32. struct volume_directory vh_vd[NVDIR]; /* other vol hdr contents */
  33. struct partition_table vh_pt[NPARTAB]; /* device partition layout */
  34. __be32 vh_csum; /* volume header checksum */
  35. __be32 vh_fill; /* fill out to 512 bytes */
  36. };
  37. /* partition type sysv is used for EFS format CD-ROM partitions */
  38. #define SGI_SYSV 0x05
  39. #define SGI_EFS 0x07
  40. #define IS_EFS(x) (((x) == SGI_EFS) || ((x) == SGI_SYSV))
  41. struct pt_types {
  42. int pt_type;
  43. char *pt_name;
  44. };
  45. #endif /* __EFS_VH_H__ */