fatdev.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981
  1. /*++
  2. Copyright (c) 2012 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. fatdev.c
  9. Abstract:
  10. This module implements the underlying device support for the FAT library
  11. in the firmware environment
  12. Author:
  13. Evan Green 23-Sep-2012
  14. Environment:
  15. Firmware
  16. --*/
  17. //
  18. // ------------------------------------------------------------------- Includes
  19. //
  20. #include <minoca/kernel/kernel.h>
  21. #include <minoca/lib/fat/fat.h>
  22. #include <uefifw.h>
  23. #include <minoca/uefi/protocol/diskio.h>
  24. #include <minoca/uefi/protocol/blockio.h>
  25. #include <minoca/uefi/protocol/sfilesys.h>
  26. #include "fatfs.h"
  27. //
  28. // ---------------------------------------------------------------- Definitions
  29. //
  30. //
  31. // ------------------------------------------------------ Data Type Definitions
  32. //
  33. /*++
  34. Structure Description:
  35. This structure defines an I/O buffer in the firmware environment.
  36. Members:
  37. Data - Stores a pointer to the I/O buffer's data buffer.
  38. Size - Stores the size of the memory buffer, in bytes.
  39. CurrentOffset - Stores the current offset into the I/O buffer. All I/O will
  40. begin at the current offset.
  41. --*/
  42. typedef struct _EFI_FAT_IO_BUFFER {
  43. VOID *Data;
  44. UINTN Size;
  45. UINTN CurrentOffset;
  46. } EFI_FAT_IO_BUFFER, *PEFI_FAT_IO_BUFFER;
  47. //
  48. // ----------------------------------------------- Internal Function Prototypes
  49. //
  50. //
  51. // -------------------------------------------------------------------- Globals
  52. //
  53. //
  54. // ------------------------------------------------------------------ Functions
  55. //
  56. PFAT_IO_BUFFER
  57. FatAllocateIoBuffer (
  58. PVOID DeviceToken,
  59. UINTN Size
  60. )
  61. /*++
  62. Routine Description:
  63. This routine allocates memory for device I/O use.
  64. Arguments:
  65. DeviceToken - Supplies an opaque token identifying the underlying device.
  66. Size - Supplies the size of the required allocation, in bytes.
  67. Return Value:
  68. Returns a pointer to the FAT I/O buffer, or NULL on failure.
  69. --*/
  70. {
  71. PEFI_FAT_IO_BUFFER IoBuffer;
  72. EFI_STATUS Status;
  73. Status = EfiAllocatePool(EfiBootServicesData,
  74. sizeof(EFI_FAT_IO_BUFFER) + Size,
  75. (VOID **)&IoBuffer);
  76. if (EFI_ERROR(Status)) {
  77. return NULL;
  78. }
  79. IoBuffer->Data = (VOID *)IoBuffer + sizeof(EFI_FAT_IO_BUFFER);
  80. IoBuffer->Size = Size;
  81. IoBuffer->CurrentOffset = 0;
  82. return IoBuffer;
  83. }
  84. PFAT_IO_BUFFER
  85. FatCreateIoBuffer (
  86. PVOID Buffer,
  87. UINTN Size
  88. )
  89. /*++
  90. Routine Description:
  91. This routine creates a FAT I/O buffer from the given buffer.
  92. Arguments:
  93. Buffer - Supplies a pointer to the memory buffer on which to base the FAT
  94. I/O buffer.
  95. Size - Supplies the size of the memory buffer, in bytes.
  96. Return Value:
  97. Returns an pointer to the FAT I/O buffer, or NULL on failure.
  98. --*/
  99. {
  100. PEFI_FAT_IO_BUFFER IoBuffer;
  101. EFI_STATUS Status;
  102. Status = EfiAllocatePool(EfiBootServicesData,
  103. sizeof(EFI_FAT_IO_BUFFER),
  104. (VOID **)&IoBuffer);
  105. if (EFI_ERROR(Status)) {
  106. return NULL;
  107. }
  108. IoBuffer->Data = Buffer;
  109. IoBuffer->Size = Size;
  110. IoBuffer->CurrentOffset = 0;
  111. return IoBuffer;
  112. }
  113. VOID
  114. FatIoBufferUpdateOffset (
  115. PFAT_IO_BUFFER FatIoBuffer,
  116. UINTN OffsetUpdate,
  117. BOOL Decrement
  118. )
  119. /*++
  120. Routine Description:
  121. This routine increments the given FAT I/O buffer's current offset by the
  122. given amount.
  123. Arguments:
  124. FatIoBuffer - Supplies a pointer to a FAT I/O buffer.
  125. OffsetUpdate - Supplies the number of bytes by which the offset will be
  126. updated.
  127. Decrement - Supplies a boolean indicating whether the update will be a
  128. decrement (TRUE) or an increment (FALSE).
  129. Return Value:
  130. None.
  131. --*/
  132. {
  133. if (Decrement == FALSE) {
  134. ((PEFI_FAT_IO_BUFFER)FatIoBuffer)->CurrentOffset += OffsetUpdate;
  135. } else {
  136. ((PEFI_FAT_IO_BUFFER)FatIoBuffer)->CurrentOffset -= OffsetUpdate;
  137. }
  138. ASSERT(((PEFI_FAT_IO_BUFFER)FatIoBuffer)->CurrentOffset <=
  139. ((PEFI_FAT_IO_BUFFER)FatIoBuffer)->Size);
  140. return;
  141. }
  142. VOID
  143. FatIoBufferSetOffset (
  144. PFAT_IO_BUFFER FatIoBuffer,
  145. UINTN Offset
  146. )
  147. /*++
  148. Routine Description:
  149. This routine sets the given FAT I/O buffer's current offset.
  150. Arguments:
  151. FatIoBuffer - Supplies a pointer to a FAT I/O buffer.
  152. Offset - Supplies the new offset to set.
  153. Return Value:
  154. None.
  155. --*/
  156. {
  157. PEFI_FAT_IO_BUFFER IoBuffer;
  158. IoBuffer = (PEFI_FAT_IO_BUFFER)FatIoBuffer;
  159. IoBuffer->CurrentOffset = Offset;
  160. ASSERT(IoBuffer->CurrentOffset <= IoBuffer->Size);
  161. return;
  162. }
  163. KSTATUS
  164. FatZeroIoBuffer (
  165. PFAT_IO_BUFFER FatIoBuffer,
  166. UINTN Offset,
  167. UINTN ByteCount
  168. )
  169. /*++
  170. Routine Description:
  171. This routine zeros the contents of the FAT I/O buffer starting at the
  172. offset for the given number of bytes.
  173. Arguments:
  174. FatIoBuffer - Supplies a pointer to the FAT I/O buffer that is to be zeroed.
  175. Offset - Supplies the offset within the I/O buffer where the zeroing should
  176. begin.
  177. ByteCount - Supplies the number of bytes to zero.
  178. Return Value:
  179. Status code.
  180. --*/
  181. {
  182. PEFI_FAT_IO_BUFFER IoBuffer;
  183. IoBuffer = (PEFI_FAT_IO_BUFFER)FatIoBuffer;
  184. EfiSetMem(IoBuffer->Data + IoBuffer->CurrentOffset + Offset, ByteCount, 0);
  185. return STATUS_SUCCESS;
  186. }
  187. KSTATUS
  188. FatCopyIoBuffer (
  189. PFAT_IO_BUFFER Destination,
  190. UINTN DestinationOffset,
  191. PFAT_IO_BUFFER Source,
  192. UINTN SourceOffset,
  193. UINTN ByteCount
  194. )
  195. /*++
  196. Routine Description:
  197. This routine copies the contents of the source I/O buffer starting at the
  198. source offset to the destination I/O buffer starting at the destination
  199. offset. It assumes that the arguments are correct such that the copy can
  200. succeed.
  201. Arguments:
  202. Destination - Supplies a pointer to the destination I/O buffer that is to
  203. be copied into.
  204. DestinationOffset - Supplies the offset into the destination I/O buffer
  205. where the copy should begin.
  206. Source - Supplies a pointer to the source I/O buffer whose contents will be
  207. copied to the destination.
  208. SourceOffset - Supplies the offset into the source I/O buffer where the
  209. copy should begin.
  210. ByteCount - Supplies the size of the requested copy in bytes.
  211. Return Value:
  212. Status code.
  213. --*/
  214. {
  215. VOID *DestinationBuffer;
  216. PEFI_FAT_IO_BUFFER DestinationIoBuffer;
  217. VOID *SourceBuffer;
  218. PEFI_FAT_IO_BUFFER SourceIoBuffer;
  219. DestinationIoBuffer = (PEFI_FAT_IO_BUFFER)Destination;
  220. DestinationBuffer = DestinationIoBuffer->Data +
  221. DestinationIoBuffer->CurrentOffset +
  222. DestinationOffset;
  223. SourceIoBuffer = (PEFI_FAT_IO_BUFFER)Source;
  224. SourceBuffer = SourceIoBuffer->Data +
  225. SourceIoBuffer->CurrentOffset +
  226. SourceOffset;
  227. EfiCopyMem(DestinationBuffer, SourceBuffer, ByteCount);
  228. return STATUS_SUCCESS;
  229. }
  230. KSTATUS
  231. FatCopyIoBufferData (
  232. PFAT_IO_BUFFER FatIoBuffer,
  233. PVOID Buffer,
  234. UINTN Offset,
  235. UINTN Size,
  236. BOOL ToIoBuffer
  237. )
  238. /*++
  239. Routine Description:
  240. This routine copies from a buffer into the given I/O buffer or out of the
  241. given I/O buffer.
  242. Arguments:
  243. FatIoBuffer - Supplies a pointer to the FAT I/O buffer to copy in or out of.
  244. Buffer - Supplies a pointer to the regular linear buffer to copy to or from.
  245. Offset - Supplies an offset in bytes from the beginning of the I/O buffer
  246. to copy to or from.
  247. Size - Supplies the number of bytes to copy.
  248. ToIoBuffer - Supplies a boolean indicating whether data is copied into the
  249. I/O buffer (TRUE) or out of the I/O buffer (FALSE).
  250. Return Value:
  251. Status code.
  252. --*/
  253. {
  254. VOID *Destination;
  255. PEFI_FAT_IO_BUFFER IoBuffer;
  256. VOID *Source;
  257. IoBuffer = (PEFI_FAT_IO_BUFFER)FatIoBuffer;
  258. ASSERT(IoBuffer->CurrentOffset + Offset + Size <= IoBuffer->Size);
  259. Destination = IoBuffer->Data + IoBuffer->CurrentOffset + Offset;
  260. Source = Buffer;
  261. if (ToIoBuffer == FALSE) {
  262. Source = Destination;
  263. Destination = Buffer;
  264. }
  265. EfiCopyMem(Destination, Source, Size);
  266. return STATUS_SUCCESS;
  267. }
  268. PVOID
  269. FatMapIoBuffer (
  270. PFAT_IO_BUFFER FatIoBuffer
  271. )
  272. /*++
  273. Routine Description:
  274. This routine maps the given FAT I/O buffer and returns the base of the
  275. virtually contiguous mapping.
  276. Arguments:
  277. FatIoBuffer - Supplies a pointer to a FAT I/O buffer.
  278. Return Value:
  279. Returns a pointer to the virtual address of the mapping on success, or
  280. NULL on failure.
  281. --*/
  282. {
  283. return ((PEFI_FAT_IO_BUFFER)FatIoBuffer)->Data;
  284. }
  285. VOID
  286. FatFreeIoBuffer (
  287. PFAT_IO_BUFFER FatIoBuffer
  288. )
  289. /*++
  290. Routine Description:
  291. This routine frees a FAT I/O buffer.
  292. Arguments:
  293. FatIoBuffer - Supplies a pointer to a FAT I/O buffer.
  294. Return Value:
  295. None.
  296. --*/
  297. {
  298. EfiFreePool(FatIoBuffer);
  299. return;
  300. }
  301. PVOID
  302. FatAllocatePagedMemory (
  303. PVOID DeviceToken,
  304. ULONG SizeInBytes
  305. )
  306. /*++
  307. Routine Description:
  308. This routine allocates paged memory for the FAT library.
  309. Arguments:
  310. DeviceToken - Supplies an opaque token identifying the underlying device.
  311. SizeInBytes - Supplies the number of bytes to allocate.
  312. Return Value:
  313. Returns a pointer to the allocated memory, or NULL on failure.
  314. --*/
  315. {
  316. VOID *Allocation;
  317. EFI_STATUS Status;
  318. Status = EfiAllocatePool(EfiBootServicesData,
  319. SizeInBytes,
  320. &Allocation);
  321. if (EFI_ERROR(Status)) {
  322. return NULL;
  323. }
  324. return Allocation;
  325. }
  326. PVOID
  327. FatAllocateNonPagedMemory (
  328. PVOID DeviceToken,
  329. ULONG SizeInBytes
  330. )
  331. /*++
  332. Routine Description:
  333. This routine allocates non-paged memory for the FAT library.
  334. Arguments:
  335. DeviceToken - Supplies an opaque token identifying the underlying device.
  336. SizeInBytes - Supplies the number of bytes to allocate.
  337. Return Value:
  338. Returns a pointer to the allocated memory, or NULL on failure.
  339. --*/
  340. {
  341. return FatAllocatePagedMemory(DeviceToken, SizeInBytes);
  342. }
  343. VOID
  344. FatFreePagedMemory (
  345. PVOID DeviceToken,
  346. PVOID Allocation
  347. )
  348. /*++
  349. Routine Description:
  350. This routine frees paged memory for the FAT library.
  351. Arguments:
  352. DeviceToken - Supplies an opaque token identifying the underlying device.
  353. Allocation - Supplies a pointer to the allocation to free.
  354. Return Value:
  355. None.
  356. --*/
  357. {
  358. EfiFreePool(Allocation);
  359. return;
  360. }
  361. VOID
  362. FatFreeNonPagedMemory (
  363. PVOID DeviceToken,
  364. PVOID Allocation
  365. )
  366. /*++
  367. Routine Description:
  368. This routine frees memory for the FAT library.
  369. Arguments:
  370. DeviceToken - Supplies an opaque token identifying the underlying device.
  371. Allocation - Supplies a pointer to the allocation to free.
  372. Return Value:
  373. None.
  374. --*/
  375. {
  376. FatFreePagedMemory(DeviceToken, Allocation);
  377. return;
  378. }
  379. KSTATUS
  380. FatCreateLock (
  381. PVOID *Lock
  382. )
  383. /*++
  384. Routine Description:
  385. This routine creates a lock.
  386. Arguments:
  387. Lock - Supplies a pointer where an opaque pointer will be returned
  388. representing the lock.
  389. Return Value:
  390. STATUS_SUCCESS on success.
  391. STATUS_INSUFFICIENT_RESOURCES if the lock could not be allocated.
  392. --*/
  393. {
  394. *Lock = NULL;
  395. return STATUS_SUCCESS;
  396. }
  397. VOID
  398. FatDestroyLock (
  399. PVOID Lock
  400. )
  401. /*++
  402. Routine Description:
  403. This routine destroys a created lock.
  404. Arguments:
  405. Lock - Supplies a the opaque pointer returned upon creation.
  406. Return Value:
  407. None.
  408. --*/
  409. {
  410. return;
  411. }
  412. VOID
  413. FatAcquireLock (
  414. PVOID Lock
  415. )
  416. /*++
  417. Routine Description:
  418. This routine acquires a lock.
  419. Arguments:
  420. Lock - Supplies a the opaque pointer returned upon creation.
  421. Return Value:
  422. None.
  423. --*/
  424. {
  425. return;
  426. }
  427. VOID
  428. FatReleaseLock (
  429. PVOID Lock
  430. )
  431. /*++
  432. Routine Description:
  433. This routine releases a lock.
  434. Arguments:
  435. Lock - Supplies a the opaque pointer returned upon creation.
  436. Return Value:
  437. None.
  438. --*/
  439. {
  440. return;
  441. }
  442. KSTATUS
  443. FatReadDevice (
  444. PVOID DeviceToken,
  445. ULONGLONG BlockAddress,
  446. UINTN BlockCount,
  447. ULONG Flags,
  448. PVOID Irp,
  449. PFAT_IO_BUFFER FatIoBuffer
  450. )
  451. /*++
  452. Routine Description:
  453. This routine reads data from the underlying disk.
  454. Arguments:
  455. DeviceToken - Supplies an opaque token identifying the underlying device.
  456. BlockAddress - Supplies the block index to read (for physical disks, this is
  457. the LBA).
  458. BlockCount - Supplies the number of blocks to read.
  459. Flags - Supplies flags regarding the I/O operation. See IO_FLAG_*
  460. definitions.
  461. Irp - Supplies an optional pointer to the IRP to pass to the read file
  462. function.
  463. FatIoBuffer - Supplies a pointer to a FAT I/O buffer where the data from
  464. the disk will be returned.
  465. Return Value:
  466. Status code.
  467. --*/
  468. {
  469. VOID *Buffer;
  470. PEFI_FAT_VOLUME Device;
  471. EFI_STATUS EfiStatus;
  472. PEFI_FAT_IO_BUFFER IoBuffer;
  473. KSTATUS Status;
  474. Device = (PEFI_FAT_VOLUME)DeviceToken;
  475. IoBuffer = (PEFI_FAT_IO_BUFFER)FatIoBuffer;
  476. ASSERT(IoBuffer != NULL);
  477. ASSERT(Device->Magic == EFI_FAT_VOLUME_MAGIC);
  478. ASSERT((ULONG)BlockCount == BlockCount);
  479. ASSERT((IoBuffer->Size - IoBuffer->CurrentOffset) >=
  480. (BlockCount * Device->BlockSize));
  481. Status = STATUS_SUCCESS;
  482. Buffer = IoBuffer->Data + IoBuffer->CurrentOffset;
  483. EfiStatus = Device->DiskIo->ReadDisk(Device->DiskIo,
  484. Device->MediaId,
  485. BlockAddress * Device->BlockSize,
  486. BlockCount * Device->BlockSize,
  487. Buffer);
  488. if (EfiStatus == EFI_MEDIA_CHANGED) {
  489. Status = STATUS_DEVICE_IO_ERROR;
  490. } else if (EfiStatus == EFI_NO_MEDIA) {
  491. Status = STATUS_NO_MEDIA;
  492. } else if (EFI_ERROR(EfiStatus)) {
  493. Status = STATUS_DEVICE_IO_ERROR;
  494. }
  495. if (!KSUCCESS(Status)) {
  496. goto ReadDeviceEnd;
  497. }
  498. Status = STATUS_SUCCESS;
  499. ReadDeviceEnd:
  500. return Status;
  501. }
  502. KSTATUS
  503. FatWriteDevice (
  504. PVOID DeviceToken,
  505. ULONGLONG BlockAddress,
  506. UINTN BlockCount,
  507. ULONG Flags,
  508. PVOID Irp,
  509. PFAT_IO_BUFFER FatIoBuffer
  510. )
  511. /*++
  512. Routine Description:
  513. This routine writes data to the underlying disk.
  514. Arguments:
  515. DeviceToken - Supplies an opaque token identifying the underlying device.
  516. BlockAddress - Supplies the block index to write to (for physical disks,
  517. this is the LBA).
  518. BlockCount - Supplies the number of blocks to write.
  519. Flags - Supplies flags regarding the I/O operation. See IO_FLAG_*
  520. definitions.
  521. Irp - Supplies an optional pointer to an IRP to use for the disk operation.
  522. FatIoBuffer - Supplies a pointer to a FAT I/O buffer containing the data to
  523. write.
  524. Return Value:
  525. Status code.
  526. --*/
  527. {
  528. VOID *Buffer;
  529. PEFI_FAT_VOLUME Device;
  530. EFI_STATUS EfiStatus;
  531. PEFI_FAT_IO_BUFFER IoBuffer;
  532. KSTATUS Status;
  533. ASSERT(FatIoBuffer != NULL);
  534. Device = (PEFI_FAT_VOLUME)DeviceToken;
  535. IoBuffer = (PEFI_FAT_IO_BUFFER)FatIoBuffer;
  536. Buffer = IoBuffer->Data + IoBuffer->CurrentOffset;
  537. Status = STATUS_SUCCESS;
  538. EfiStatus = Device->DiskIo->WriteDisk(Device->DiskIo,
  539. Device->MediaId,
  540. BlockAddress * Device->BlockSize,
  541. BlockCount * Device->BlockSize,
  542. Buffer);
  543. if (EfiStatus == EFI_MEDIA_CHANGED) {
  544. Status = STATUS_DEVICE_IO_ERROR;
  545. } else if (EfiStatus == EFI_NO_MEDIA) {
  546. Status = STATUS_NO_MEDIA;
  547. } else if (EFI_ERROR(EfiStatus)) {
  548. Status = STATUS_DEVICE_IO_ERROR;
  549. }
  550. if (!KSUCCESS(Status)) {
  551. goto WriteDeviceEnd;
  552. }
  553. WriteDeviceEnd:
  554. return Status;
  555. }
  556. KSTATUS
  557. FatGetDeviceBlockInformation (
  558. PVOID DeviceToken,
  559. PFILE_BLOCK_INFORMATION BlockInformation
  560. )
  561. /*++
  562. Routine Description:
  563. This routine converts a file's block information into disk level block
  564. information by modifying the offsets of each contiguous run.
  565. Arguments:
  566. DeviceToken - Supplies an opaque token identify the underlying device.
  567. BlockInformation - Supplies a pointer to the block information to be
  568. updated.
  569. Return Value:
  570. Status code.
  571. --*/
  572. {
  573. ASSERT(FALSE);
  574. return STATUS_NOT_IMPLEMENTED;
  575. }
  576. ULONG
  577. FatGetIoCacheEntryDataSize (
  578. VOID
  579. )
  580. /*++
  581. Routine Description:
  582. This routine returns the size of data stored in each cache entry.
  583. Arguments:
  584. None.
  585. Return Value:
  586. Returns the size of the data stored in each cache entry, or 0 if there is
  587. no cache.
  588. --*/
  589. {
  590. return 0;
  591. }
  592. ULONG
  593. FatGetPageSize (
  594. VOID
  595. )
  596. /*++
  597. Routine Description:
  598. This routine returns the size of a physical memory page for the current FAT
  599. environment.
  600. Arguments:
  601. None.
  602. Return Value:
  603. Returns the size of a page in the current environment. Returns 0 if the
  604. size is not known.
  605. --*/
  606. {
  607. return EFI_PAGE_SIZE;
  608. }
  609. VOID
  610. FatGetCurrentSystemTime (
  611. PSYSTEM_TIME SystemTime
  612. )
  613. /*++
  614. Routine Description:
  615. This routine returns the current system time.
  616. Arguments:
  617. SystemTime - Supplies a pointer where the current system time will be
  618. returned.
  619. Return Value:
  620. None.
  621. --*/
  622. {
  623. EfiSetMem(SystemTime, sizeof(SYSTEM_TIME), 0);
  624. return;
  625. }
  626. //
  627. // --------------------------------------------------------- Internal Functions
  628. //