Lines Matching refs:SS

264 #define SS(fs)	((UINT)FF_MAX_SS)	/* Fixed sector size */  macro
266 #define SS(fs) ((fs)->ssize) /* Variable sector size */ macro
1196 if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break; in get_fat()
1197 wc = fs->win[bc++ % SS(fs)]; /* Get 1st byte of the entry */ in get_fat()
1198 if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break; in get_fat()
1199 wc |= fs->win[bc % SS(fs)] << 8; /* Merge 2nd byte of the entry */ in get_fat()
1204 if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break; in get_fat()
1205 val = ld_word(fs->win + clst * 2 % SS(fs)); /* Simple WORD array */ in get_fat()
1209 if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break; in get_fat()
1210 …val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x0FFFFFFF; /* Simple DWORD array but mask out upper… in get_fat()
1216 …DWORD clen = (DWORD)((LBA_t)((obj->objsize - 1) / SS(fs)) / fs->csize); /* Number of clusters - 1 … in get_fat()
1230 if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break; in get_fat()
1231 val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x7FFFFFFF; in get_fat()
1270 res = move_window(fs, fs->fatbase + (bc / SS(fs))); in put_fat()
1272 p = fs->win + bc++ % SS(fs); in put_fat()
1275 res = move_window(fs, fs->fatbase + (bc / SS(fs))); in put_fat()
1277 p = fs->win + bc % SS(fs); in put_fat()
1283 res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))); in put_fat()
1285 st_word(fs->win + clst * 2 % SS(fs), (WORD)val); /* Simple WORD array */ in put_fat()
1293 res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))); 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()
1335 if (move_window(fs, fs->bitbase + val / 8 / SS(fs)) != FR_OK) return 0xFFFFFFFF; in find_bitmap()
1336 i = val / 8 % SS(fs); bm = 1 << (val % 8); in find_bitmap()
1341 val = 0; bm = 0; i = SS(fs); in find_bitmap()
1351 } while (++i < SS(fs)); in find_bitmap()
1373 sect = fs->bitbase + clst / 8 / SS(fs); /* Sector address */ in change_bitmap()
1374 i = clst / 8 % SS(fs); /* Byte offset in the sector */ in change_bitmap()
1386 } while (++i < SS(fs)); /* Next byte */ in change_bitmap()
1656 cl = (DWORD)(ofs / SS(fs) / fs->csize); /* Cluster order from top of the file */ in clmt_clust()
1692 …for (szb = ((DWORD)fs->csize * SS(fs) >= MAX_MALLOC) ? MAX_MALLOC : fs->csize * SS(fs), ibuf = 0; … in dir_clear()
1693 if (szb > SS(fs)) { /* Buffer allocated? */ in dir_clear()
1695 szb /= SS(fs); /* Bytes -> Sectors */ in dir_clear()
1739 csz = (DWORD)fs->csize * SS(fs); /* Bytes per cluster */ in dir_sdi()
1750 dp->sect += ofs / SS(fs); /* Sector# of the directory entry */ in dir_sdi()
1751 dp->dir = fs->win + (ofs % SS(fs)); /* Pointer to the entry in the win[] */ in dir_sdi()
1776 if (ofs % SS(fs) == 0) { /* Sector changed? */ in dir_next()
1785 if ((ofs / SS(fs) & (fs->csize - 1)) == 0) { /* Cluster changed? */ in dir_next()
1811 dp->dir = fs->win + ofs % SS(fs); /* Pointer to the entry in the win[] */ in dir_next()
2519 dp->obj.objsize += (DWORD)fs->csize * SS(fs); /* Increase the directory size by cluster size */
3145 dp->obj.sclust = ld_clust(fs, fs->win + dp->dptr % SS(fs)); /* Open next directory */
3371 if (move_window(fs, pt_lba + i * SZ_GPTE / SS(fs)) != FR_OK) return 4; /* PT sector */
3372 ofs = i * SZ_GPTE % SS(fs); /* Offset in the sector */
3452 if (disk_ioctl(fs->pdrv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK) return FR_DISK_ERR;
3453 if (SS(fs) > FF_MAX_SS || SS(fs) < FF_MIN_SS || (SS(fs) & (SS(fs) - 1))) return FR_DISK_ERR;
3474 …if (1 << fs->win[BPB_BytsPerSecEx] != SS(fs)) { /* (BPB_BytsPerSecEx must be equal to the physical…
3509 i = (i + SZDIRE) % SS(fs); /* Next entry */
3515 if (move_window(fs, fs->fatbase + bcl / (SS(fs) / 4)) != FR_OK) return FR_DISK_ERR;
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 …
3543 if (fs->n_rootdir % (SS(fs) / SZDIRE)) return FR_NO_FILESYSTEM; /* (Must be sector aligned) */
3552 sysect = nrsv + fasize + fs->n_rootdir / (SS(fs) / SZDIRE); /* RSV + FAT + DIR */
3578 …if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_FATSz must not …
3888 bcs = (DWORD)fs->csize * SS(fs); /* Cluster size in byte */
3896 if (res == FR_OK && ofs % SS(fs)) { /* Fill sector buffer if not on the sector boundary */
3901 fp->sect = sc + (DWORD)(ofs / SS(fs));
3953 if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */
3954 csect = (UINT)(fp->fptr / SS(fs) & (fs->csize - 1)); /* Sector offset in the cluster */
3975 cc = btr / SS(fs); /* When remaining bytes >= sector size, */
3984 memcpy(rbuff + ((fs->winsect - sect) * SS(fs)), fs->win, SS(fs));
3988 memcpy(rbuff + ((fp->sect - sect) * SS(fs)), fp->buf, SS(fs));
3992 rcnt = SS(fs) * cc; /* Number of bytes transferred */
4008 rcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes remains in the sector */
4012 memcpy(rbuff, fs->win + fp->fptr % SS(fs), rcnt); /* Extract partial sector */
4014 memcpy(rbuff, fp->buf + fp->fptr % SS(fs), rcnt); /* Extract partial sector */
4055 if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */
4056 csect = (UINT)(fp->fptr / SS(fs)) & (fs->csize - 1); /* Sector offset in the cluster */
4090 cc = btw / SS(fs); /* When remaining bytes >= sector size, */
4099 memcpy(fs->win, wbuff + ((fs->winsect - sect) * SS(fs)), SS(fs));
4104 memcpy(fp->buf, wbuff + ((fp->sect - sect) * SS(fs)), SS(fs));
4109 wcnt = SS(fs) * cc; /* Number of bytes transferred */
4126 wcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes remains in the sector */
4130 memcpy(fs->win + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */
4133 memcpy(fp->buf + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */
4507 dsc += (DWORD)((ofs - 1) / SS(fs)) & (fs->csize - 1);
4508 if (fp->fptr % SS(fs) && dsc != fp->sect) { /* Refill sector cache if needed */
4536 bcs = (DWORD)fs->csize * SS(fs); /* Cluster size (byte) */
4577 if (ofs % SS(fs)) {
4580 nsect += (DWORD)(ofs / SS(fs));
4588 if (fp->fptr % SS(fs) && nsect != fp->sect) { /* Fill sector cache if needed */
4885 i = (i + 1) % SS(fs); /* Next byte */
4905 i %= SS(fs);
5122 …st_dword(fs->dirbuf + XDIR_FileSize, (DWORD)fs->csize * SS(fs)); /* Directory size needs to be val…
5123 st_dword(fs->dirbuf + XDIR_ValidFileSize, (DWORD)fs->csize * SS(fs));
5600 n = (DWORD)fs->csize * SS(fs); /* Cluster size */
5704 csect = (UINT)(fp->fptr / SS(fs) & (fs->csize - 1)); /* Sector offset in the cluster */
5705 if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */
5733 rcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes remains in the sector */
5735 rcnt = (*func)(dbuf + ((UINT)fp->fptr % SS(fs)), rcnt); /* Forward the file data */