Lines Matching refs:win

1066 		if (disk_write(fs->pdrv, fs->win, fs->winsect, 1) == RES_OK) {	/* Write it back into the volume */  in sync_window()
1069 …if (fs->n_fats == 2) disk_write(fs->pdrv, fs->win, fs->winsect + fs->fsize, 1); /* Reflect it to 2… in sync_window()
1093 if (disk_read(fs->pdrv, fs->win, sect, 1) != RES_OK) { in move_window()
1124 memset(fs->win, 0, sizeof fs->win); in sync_fs()
1125 st_dword(fs->win + FSI_LeadSig, 0x41615252); /* Leading signature */ in sync_fs()
1126 st_dword(fs->win + FSI_StrucSig, 0x61417272); /* Structure signature */ in sync_fs()
1127 st_dword(fs->win + FSI_Free_Count, fs->free_clst); /* Number of free clusters */ in sync_fs()
1128 st_dword(fs->win + FSI_Nxt_Free, fs->last_clst); /* Last allocated culuster */ in sync_fs()
1129 st_dword(fs->win + FSI_TrailSig, 0xAA550000); /* Trailing signature */ in sync_fs()
1130 …disk_write(fs->pdrv, fs->win, fs->winsect = fs->volbase + 1, 1); /* Write it into the FSInfo secto… in sync_fs()
1134 if (disk_read(fs->pdrv, fs->win, fs->winsect = fs->volbase, 1) == RES_OK) { /* Load VBR */ in sync_fs()
1137 if (fs->win[BPB_PercInUseEx] != perc_inuse) { /* Write it back into VBR if needed */ in sync_fs()
1138 fs->win[BPB_PercInUseEx] = perc_inuse; in sync_fs()
1139 disk_write(fs->pdrv, fs->win, fs->winsect, 1); in sync_fs()
1197 wc = fs->win[bc++ % SS(fs)]; /* Get 1st byte of the entry */ in get_fat()
1199 wc |= fs->win[bc % SS(fs)] << 8; /* Merge 2nd byte of the entry */ in get_fat()
1205 val = ld_word(fs->win + clst * 2 % SS(fs)); /* Simple WORD array */ in get_fat()
1210 …val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x0FFFFFFF; /* Simple DWORD array but mask out upper… in get_fat()
1231 val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x7FFFFFFF; in get_fat()
1272 p = fs->win + bc++ % SS(fs); in put_fat()
1277 p = fs->win + bc % SS(fs); in put_fat()
1285 st_word(fs->win + clst * 2 % SS(fs), (WORD)val); /* Simple WORD array */ in put_fat()
1296 val = (val & 0x0FFFFFFF) | (ld_dword(fs->win + clst * 4 % SS(fs)) & 0xF0000000); in put_fat()
1298 st_dword(fs->win + clst * 4 % SS(fs), val); in put_fat()
1339 bv = fs->win[i] & bm; bm <<= 1; /* Get bit value */ in find_bitmap()
1380 if (bv == (int)((fs->win[i] & bm) != 0)) return FR_INT_ERR; /* Is the bit expected value? */ in change_bitmap()
1381 fs->win[i] ^= bm; /* Flip the bit */ in change_bitmap()
1689 memset(fs->win, 0, sizeof fs->win); /* Clear window buffer */ in dir_clear()
1701 ibuf = fs->win; szb = 1; /* Use window buffer (many single-sector writes may take a time) */ in dir_clear()
1751 dp->dir = fs->win + (ofs % SS(fs)); /* Pointer to the entry in the win[] */ in dir_sdi()
1811 dp->dir = fs->win + ofs % SS(fs); /* Pointer to the entry in the win[] */ in dir_next()
3145 dp->obj.sclust = ld_clust(fs, fs->win + dp->dptr % SS(fs)); /* Open next directory */
3318 sign = ld_word(fs->win + BS_55AA);
3320 …if (sign == 0xAA55 && !memcmp(fs->win + BS_JmpBoot, "\xEB\x76\x90" "EXFAT ", 11)) return 1; /* I…
3322 b = fs->win[BS_JmpBoot];
3324 if (sign == 0xAA55 && !memcmp(fs->win + BS_FilSysType32, "FAT32 ", 8)) {
3328 w = ld_word(fs->win + BPB_BytsPerSec);
3329 b = fs->win[BPB_SecPerClus];
3332 && ld_word(fs->win + BPB_RsvdSecCnt) != 0 /* Properness of number of reserved sectors (MNBZ) */
3333 && (UINT)fs->win[BPB_NumFATs] - 1 <= 1 /* Properness of number of FATs (1 or 2) */
3334 && ld_word(fs->win + BPB_RootEntCnt) != 0 /* Properness of root dir size (MNBZ) */
3335 …&& (ld_word(fs->win + BPB_TotSec16) >= 128 || ld_dword(fs->win + BPB_TotSec32) >= 0x10000) /* Prop…
3336 && ld_word(fs->win + BPB_FATSz16) != 0) { /* Properness of FAT size (MNBZ) */
3362 if (fs->win[MBR_Table + PTE_System] == 0xEE) { /* GPT protective MBR? */
3367 if (!test_gpt_header(fs->win)) return 3; /* Check if GPT header is valid */
3368 n_ent = ld_dword(fs->win + GPTH_PtNum); /* Number of entries */
3369 pt_lba = ld_qword(fs->win + GPTH_PtOfs); /* Table location */
3373 if (!memcmp(fs->win + ofs + GPTE_PtGuid, GUID_MS_Basic, 16)) { /* MS basic data partition? */
3375 fmt = check_fs(fs, ld_qword(fs->win + ofs + GPTE_FstLba)); /* Load VBR and check status */
3385 mbr_pt[i] = ld_dword(fs->win + MBR_Table + i * SZ_PTE + PTE_StLba);
3469 for (i = BPB_ZeroedEx; i < BPB_ZeroedEx + 53 && fs->win[i] == 0; i++) ; /* Check zero filler */
3472 …if (ld_word(fs->win + BPB_FSVerEx) != 0x100) return FR_NO_FILESYSTEM; /* Check exFAT version (must…
3474 …if (1 << fs->win[BPB_BytsPerSecEx] != SS(fs)) { /* (BPB_BytsPerSecEx must be equal to the physical…
3478 maxlba = ld_qword(fs->win + BPB_TotSecEx) + bsect; /* Last LBA of the volume + 1 */
3481 fs->fsize = ld_dword(fs->win + BPB_FatSzEx); /* Number of sectors per FAT */
3483 fs->n_fats = fs->win[BPB_NumFATsEx]; /* Number of FATs */
3486 fs->csize = 1 << fs->win[BPB_SecPerClusEx]; /* Cluster size */
3489 nclst = ld_dword(fs->win + BPB_NumClusEx); /* Number of clusters */
3495 fs->database = bsect + ld_dword(fs->win + BPB_DataOfsEx);
3496 fs->fatbase = bsect + ld_dword(fs->win + BPB_FatOfsEx);
3498 fs->dirbase = ld_dword(fs->win + BPB_RootClusEx);
3508 if (fs->win[i] == ET_BITMAP) break; /* Is it a bitmap entry? */
3511 bcl = ld_dword(fs->win + i + 20); /* Bitmap cluster */
3516 cv = ld_dword(fs->win + bcl % (SS(fs) / 4) * 4);
3529 …if (ld_word(fs->win + BPB_BytsPerSec) != SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_BytsPerSec must …
3531 fasize = ld_word(fs->win + BPB_FATSz16); /* Number of sectors per FAT */
3532 if (fasize == 0) fasize = ld_dword(fs->win + BPB_FATSz32);
3535 fs->n_fats = fs->win[BPB_NumFATs]; /* Number of FATs */
3539 fs->csize = fs->win[BPB_SecPerClus]; /* Cluster size */
3542 fs->n_rootdir = ld_word(fs->win + BPB_RootEntCnt); /* Number of root directory entries */
3545 tsect = ld_word(fs->win + BPB_TotSec16); /* Number of sectors on the volume */
3546 if (tsect == 0) tsect = ld_dword(fs->win + BPB_TotSec32);
3548 nrsv = ld_word(fs->win + BPB_RsvdSecCnt); /* Number of reserved sectors */
3568 …if (ld_word(fs->win + BPB_FSVer32) != 0) return FR_NO_FILESYSTEM; /* (Must be FAT32 revision 0.0) …
3570 fs->dirbase = ld_dword(fs->win + BPB_RootClus32); /* Root directory start cluster */
3585 …&& ld_word(fs->win + BPB_FSInfo32) == 1 /* FAT32: Enable FSInfo feature only if FSInfo sector is n…
3589 if ( ld_dword(fs->win + FSI_LeadSig) == 0x41615252 /* Load FSInfo data if available */
3590 && ld_dword(fs->win + FSI_StrucSig) == 0x61417272
3591 && ld_dword(fs->win + FSI_TrailSig) == 0xAA550000)
3594 fs->free_clst = ld_dword(fs->win + FSI_Free_Count);
3597 fs->last_clst = ld_dword(fs->win + FSI_Nxt_Free);
3984 memcpy(rbuff + ((fs->winsect - sect) * SS(fs)), fs->win, SS(fs));
4012 memcpy(rbuff, fs->win + fp->fptr % SS(fs), rcnt); /* Extract partial sector */
4099 memcpy(fs->win, wbuff + ((fs->winsect - sect) * SS(fs)), SS(fs));
4130 memcpy(fs->win + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */
4881 for (b = 8, bm = ~fs->win[i]; b && clst; b--, clst--) { /* Count clear bits in a byte */
4899 if (ld_word(fs->win + i) == 0) nfree++; /* FAT16: Is this cluster free? */
4902 if ((ld_dword(fs->win + i) & 0x0FFFFFFF) == 0) nfree++; /* FAT32: Is this cluster free? */
5104 memset(fs->win + DIR_Name, ' ', 11); /* Create "." entry */
5105 fs->win[DIR_Name] = '.';
5106 fs->win[DIR_Attr] = AM_DIR;
5107 st_dword(fs->win + DIR_ModTime, tm);
5108 st_clust(fs, fs->win, dcl);
5109 memcpy(fs->win + SZDIRE, fs->win, SZDIRE); /* Create ".." entry */
5110 fs->win[SZDIRE + 1] = '.'; pcl = dj.obj.sclust;
5111 st_clust(fs, fs->win + SZDIRE, pcl);
5229 dir = fs->win + SZDIRE * 1; /* Pointer to .. entry */
5444 di = fs->win[BS_BootSig] == 0x29 ? BS_VolID : 0;
5446 *vsn = di ? ld_dword(fs->win + di) : 0; /* Get VSN in the VBR */
5719 dbuf = fs->win;