Home | History | Annotate | Download | only in mac68k

Lines Matching refs:MAP

78 MAP map = {0, 0, 0, 0, 0, 0, 0, 0, {0}, NULL};
210 map.size = 0;
222 * Scan for the Partition Map entry that describes the Partition
223 * Map itself. We need to know the number of blocks allocated
230 map.size = block.pmPartBlkCnt;
231 map.in_use_cnt = block.pmMapBlkCnt;
232 map.blk = (struct apple_part_map_entry *)malloc(map.size * blk_size);
237 read(fd, map.blk, map.size * blk_size);
262 * ask to reedit the Disk Partition Map.
280 * Now, scan through the Disk Partition Map and transfer the
283 for (i=0;i<map.usable_cnt;i++) {
284 j = map.mblk[i];
285 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
289 switch (whichType(&map.blk[j])) {
311 info.start = map.blk[j].pmPyPartStart;
312 info.size = map.blk[j].pmPartBlkCnt;
381 fprintf(stderr, "Can't open %s to rewrite the Disk Map\n", dev_name);
386 * Partition Map. It should be zero, but if it's 0xa5a5 that means
389 if (map.blk[0].pmSigPad == 0xa5a5) {
403 map.blk[0].pmSigPad = 0;
407 fprintf (stderr, "Can't position disk to rewrite Disk Map\n");
411 if (write (fd, map.blk, map.size * blk_size) != (map.size * blk_size)) {
413 fprintf(stderr, "I/O error writing Disk Map\n");
434 * rewrite it to disk. As a result, the ondisk partition map is
800 bzb = (EBZB *)&map.blk[i].pmBootArgs[0];
801 if (whichType(&map.blk[i]) != type || bzb->flags.used)
806 setpartition(&map.blk[i], in_use, 0);
812 setpartition(&map.blk[i], in_use, 6);
817 setpartition(&map.blk[i], in_use, 1);
875 * 1) Moves all the Partition Map entries to the front of the Map.
893 * the Map. Also convert any "old" Map entries to the new entry
897 map.in_use_cnt = 0;
898 for (i=0;i<map.size-1;i++) {
899 if (map.blk[i].pmSig == 0x5453)
900 map.blk[i].pmSig = APPLE_PART_MAP_ENTRY_MAGIC;
901 if (map.blk[i].pmSig != APPLE_PART_MAP_ENTRY_MAGIC) {
902 for (j=i+1;j<map.size;j++) {
903 if (map.blk[j].pmSig == 0x5453)
904 map.blk[j].pmSig = APPLE_PART_MAP_ENTRY_MAGIC;
905 if (map.blk[j].pmSig == APPLE_PART_MAP_ENTRY_MAGIC) {
906 memcpy (&map.blk[i], &map.blk[j], sizeof(map.blk[i]));
907 map.blk[j].pmSig = 0;
912 map.in_use_cnt += 1;
913 bzb = (EBZB *)&map.blk[i].pmBootArgs[0];
924 for (i=0;i<map.in_use_cnt-1;i++) {
925 for (j=i+1;j<map.in_use_cnt;j++) {
926 if (map.blk[i].pmPyPartStart > map.blk[j].pmPyPartStart) {
927 memcpy (&tmp_blk, &map.blk[i], sizeof(tmp_blk));
928 memcpy (&map.blk[i], &map.blk[j], sizeof(map.blk[i]));
929 memcpy (&map.blk[j], &tmp_blk, sizeof(map.blk[j]));
937 for (i=0;i<map.in_use_cnt-1;i++) {
938 if (stricmp("Apple_Free", (char *)map.blk[i].pmPartType) == 0 &&
939 stricmp("Apple_Free", (char *)map.blk[i+1].pmPartType) == 0) {
940 map.blk[i].pmPartBlkCnt += map.blk[i+1].pmPartBlkCnt;
941 map.blk[i].pmDataCnt += map.blk[i+1].pmDataCnt;
942 map.blk[i+1].pmSig = 0;
943 for (j=i+1;j<map.in_use_cnt-1;j++) {
944 memcpy (&map.blk[j], &map.blk[j+1], sizeof(map.blk[j]));
945 map.blk[j+1].pmSig = 0;
947 map.in_use_cnt -= 1;
953 * and adjust the pmMapBlkCnt in each Map entry. Set
957 map.hfs_cnt = 0;
958 map.root_cnt = 0;
959 map.swap_cnt = 0;
960 map.usr_cnt = 0;
961 map.usable_cnt = 0;
966 for (i=0,j=0;i<map.in_use_cnt;i++) {
967 map.blk[i].pmSig = APPLE_PART_MAP_ENTRY_MAGIC;
968 map.blk[i].pmMapBlkCnt = map.in_use_cnt;
972 * If/when MAXPARTITIONS is changed, the "Edit Disk Partition Map"
975 if (whichType(&map.blk[i]) && (j < MAXPARTITIONS - 1)) {
976 map.mblk[j++] = i;
977 map.usable_cnt += 1;
984 if (findStdType(map.in_use_cnt, in_use, ROOT_PART, &map.root_cnt, 0))
985 findStdType(map.in_use_cnt, in_use, ROOT_PART, &map.root_cnt, -1);
986 if (findStdType(map.in_use_cnt, in_use, UFS_PART, &map.usr_cnt, 0))
987 findStdType(map.in_use_cnt, in_use, UFS_PART, &map.usr_cnt, -1);
988 if (findStdType(map.in_use_cnt, in_use, SWAP_PART, &map.swap_cnt, 0))
989 findStdType(map.in_use_cnt, in_use, SWAP_PART, &map.swap_cnt, -1);
996 * assigning them the slot the where the kernel should map them.
997 * This will be where they are displayed in the Edit Map.
999 for (i=0; i < map.in_use_cnt; i++) {
1000 bzb = (EBZB *)&map.blk[i].pmBootArgs[0];
1004 switch (whichType(&map.blk[i])) {
1006 map.root_cnt += 1;
1007 setpartition(&map.blk[i], in_use, j);
1010 map.usr_cnt += 1;
1011 setpartition(&map.blk[i], in_use, j);
1014 map.swap_cnt += 1;
1015 setpartition(&map.blk[i], in_use, j);
1018 map.hfs_cnt += 1;
1019 setpartition(&map.blk[i], in_use, j);
1022 setpartition(&map.blk[i], in_use, j);
1043 for (i=0;i<map.usable_cnt;i++) {
1045 j = map.mblk[i];
1046 getFstype(&map.blk[j], sizeof(fstyp), fstyp);
1047 getUse(&map.blk[j], sizeof(use), use);
1048 getName(&map.blk[j], sizeof(name), name);
1049 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
1052 bzb->flags.part, map.blk[j].pmPyPartStart,
1053 map.blk[j].pmPartBlkCnt, fstyp, use, name);
1068 errs = (!map.root_cnt) || (map.root_cnt > 1) || (!map.swap_cnt) ||
1069 (map.swap_cnt > 1);
1071 for (i=0;i<map.usable_cnt;i++) {
1072 j = map.mblk[i];
1073 if (map.blk[j].pmPyPartStart > pm->dlsize)
1075 if ((map.blk[j].pmPyPartStart + map.blk[j].pmPartBlkCnt) > pm->dlsize + 1)
1091 if (!map.root_cnt) {
1095 if (map.root_cnt > 1) {
1099 if (!map.swap_cnt) {
1103 if (map.swap_cnt > 1) {
1107 for (i=0;i<map.usable_cnt;i++) {
1108 j = map.mblk[i];
1109 if (map.blk[j].pmPyPartStart > pm->dlsize) {
1110 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
1115 if ((map.blk[j].pmPyPartStart + map.blk[j].pmPartBlkCnt) > pm->dlsize) {
1116 bzb = (EBZB *)&map.blk[j].pmBootArgs[0];
1136 map.selected = 0;
1142 if (map.usable_cnt > (map.root_cnt+map.swap_cnt+map.usr_cnt)) {
1151 * then sort and merge the map into something sensible
1153 for (i=0;i<map.size;i++)
1154 if (whichType(&map.blk[i]))
1155 strcpy ((char *)map.blk[i].pmPartType, "Apple_Free");
1173 sprintf(buf, "Apple Disk Partition Map: %s", title);
1177 for (i=0;i<map.in_use_cnt;i++) {
1178 j = whichType(&map.blk[i]);
1179 getFstype(&map.blk[i], sizeof(fstyp), fstyp);
1180 getUse(&map.blk[i], sizeof(use), use);
1181 getName(&map.blk[i], sizeof(name), name);
1182 bzb = (EBZB *) &map.blk[i].pmBootArgs[0];
1187 map.blk[i].pmPyPartStart, fstyp, use, name);