Chameleon

Chameleon Commit Details

Date:2015-01-13 00:33:19 (5 years 9 months ago)
Author:ErmaC
Commit:2536
Parents: 2535
Message:Sync with trunk(r.2535)
Changes:
M/branches/ErmaC/Enoch/CHANGES
M/branches/ErmaC/Enoch/i386/libsaio/exfat.c

File differences

branches/ErmaC/Enoch/i386/libsaio/exfat.c
227227
228228
229229
230
230
231231
232232
233233
......
236236
237237
238238
239
239240
240
241
242
243
244
241245
242246
243247
......
273277
274278
275279
276
277
280
281
282
283
284
278285
279286
280287
......
375382
376383
377384
378
379
385
386
387
388
389
380390
381391
382392
......
630640
631641
632642
633
643
644
645
646
634647
635648
636649
......
667680
668681
669682
670
683
684
671685
672686
673687
......
685699
686700
687701
702
703
688704
689705
690706
#pragma mark -
static
int FATCacheInit(void)
int FATCacheInit(int invalidate)
{
if (!gFATCacheBuffer)
{
{
return -1;
}
invalidate = 1;
}
gCachedFATBlockAddress = INVALID_FAT_ADDRESS;
if (invalidate)
{
gCachedFATBlockAddress = INVALID_FAT_ADDRESS;
}
return 0;
}
lcba = cluster >> shift;
if (lcba != gCachedFATBlockAddress)
{
Seek(gCurrentIH, (((long long) gFATOffset) << gBPSShift) + (((long long) lcba) << gBPCBShift));
Read(gCurrentIH, (long) gFATCacheBuffer, CacheBlockSize());
CacheRead(gCurrentIH,
(char*) gFATCacheBuffer,
(((long long) gFATOffset) << gBPSShift) + (((long long) lcba) << gBPCBShift),
CacheBlockSize(),
1);
gCachedFATBlockAddress = lcba;
}
lcba = cluster + 1;
toRead = (uint16_t) (1 << (gBPCBShift - gBPSShift));
if (pIter->lsa + toRead > pIter->lsa_end)
toRead = (uint16_t) (pIter->lsa_end - pIter->lsa);
Seek(gCurrentIH, (long long) (pIter->lsa << gBPSShift));
Read(gCurrentIH, (long) pIter->buffer, ((long) toRead) << gBPSShift);
CacheRead(gCurrentIH,
(char*) pIter->buffer,
(long long) (pIter->lsa << gBPSShift),
((uint32_t) toRead) << gBPSShift,
1);
pIter->lsa += toRead;
pIter->entry_offset = 0;
}
if (!ih)
return -1;
if (gCurrentIH == ih)
return FATCacheInit();
{
CacheInit(ih, CacheBlockSize());
return FATCacheInit(0);
}
buffer = (uint8_t*) malloc(BPS);
if (!buffer)
return -1;
}
if (FATCacheInit() < 0) {
if (FATCacheInit(1) < 0)
{
free(buffer);
return -1;
}
gCurrentIH = ih;
CacheInit(ih, CacheBlockSize());
free(buffer);
return 0;
}
branches/ErmaC/Enoch/CHANGES
1
12
23
34
- Zenith432 : Use caching with ExFat filesystem
- Zenith432 : Add turning off USB legacy for XHCI (XHCILegacyOff)
- Zenith432 : saio_types.h, biosfn.c - minor typo in bios-defined data structure that isn't actually used.
fake_efi.c - eliminate redundant scan of bt(0,0) in setupSmbiosConfigFile. loadConfigFile already does a fall-back scan of bt(0,0), so another scan isn't needed.

Archive Download the corresponding diff file

Revision: 2536