fx_utility.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /***************************************************************************
  2. * Copyright (c) 2024 Microsoft Corporation
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the MIT License which is available at
  6. * https://opensource.org/licenses/MIT.
  7. *
  8. * SPDX-License-Identifier: MIT
  9. **************************************************************************/
  10. /**************************************************************************/
  11. /**************************************************************************/
  12. /** */
  13. /** FileX Component */
  14. /** */
  15. /** Utility */
  16. /** */
  17. /**************************************************************************/
  18. /**************************************************************************/
  19. /**************************************************************************/
  20. /* */
  21. /* COMPONENT DEFINITION RELEASE */
  22. /* */
  23. /* fx_utility.h PORTABLE C */
  24. /* 6.1 */
  25. /* AUTHOR */
  26. /* */
  27. /* William E. Lamie, Microsoft Corporation */
  28. /* */
  29. /* DESCRIPTION */
  30. /* */
  31. /* This file defines the FileX Utility component constants, data */
  32. /* definitions, and external references. It is assumed that fx_api.h */
  33. /* (and fx_port.h) have already been included. */
  34. /* */
  35. /* RELEASE HISTORY */
  36. /* */
  37. /* DATE NAME DESCRIPTION */
  38. /* */
  39. /* 05-19-2020 William E. Lamie Initial Version 6.0 */
  40. /* 09-30-2020 William E. Lamie Modified comment(s), */
  41. /* resulting in version 6.1 */
  42. /* */
  43. /**************************************************************************/
  44. #ifndef FX_UTILITY_H
  45. #define FX_UTILITY_H
  46. /* Define the internal Utility component function prototypes. */
  47. UINT _fx_utility_16_unsigned_read(UCHAR *source_ptr);
  48. VOID _fx_utility_16_unsigned_write(UCHAR *dest_ptr, UINT value);
  49. ULONG _fx_utility_32_unsigned_read(UCHAR *source_ptr);
  50. VOID _fx_utility_32_unsigned_write(UCHAR *dest_ptr, ULONG value);
  51. ULONG64 _fx_utility_64_unsigned_read(UCHAR *source_ptr);
  52. VOID _fx_utility_64_unsigned_write(UCHAR *dest_ptr, ULONG64 value);
  53. VOID _fx_utility_memory_copy(UCHAR *source_ptr, UCHAR *dest_ptr, ULONG size);
  54. VOID _fx_utility_memory_set(UCHAR *dest_ptr, UCHAR value, ULONG size);
  55. FX_CACHED_SECTOR
  56. *_fx_utility_logical_sector_cache_entry_read(FX_MEDIA *media_ptr, ULONG64 logical_sector, FX_CACHED_SECTOR **previous_cache_entry);
  57. UINT _fx_utility_logical_sector_read(FX_MEDIA *media_ptr, ULONG64 logical_sector,
  58. VOID *buffer_ptr, ULONG sectors, UCHAR sector_type);
  59. UINT _fx_utility_logical_sector_write(FX_MEDIA *media_ptr, ULONG64 logical_sector,
  60. VOID *buffer_ptr, ULONG sectors, UCHAR sector_type);
  61. UINT _fx_utility_logical_sector_flush(FX_MEDIA *media_ptr, ULONG64 starting_sector, ULONG64 sectors, UINT invalidate);
  62. UINT _fx_utility_FAT_entry_read(FX_MEDIA *media_ptr, ULONG cluster, ULONG *entry_ptr);
  63. UINT _fx_utility_FAT_entry_write(FX_MEDIA *media_ptr, ULONG cluster, ULONG next_cluster);
  64. UINT _fx_utility_FAT_flush(FX_MEDIA *media_ptr);
  65. UINT _fx_utility_FAT_map_flush(FX_MEDIA *media_ptr);
  66. ULONG _fx_utility_FAT_sector_get(FX_MEDIA *media_ptr, ULONG cluster);
  67. UINT _fx_utility_string_length_get(CHAR *string, UINT max_length);
  68. #endif