fx_system.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. /** System */
  16. /** */
  17. /**************************************************************************/
  18. /**************************************************************************/
  19. /**************************************************************************/
  20. /* */
  21. /* COMPONENT DEFINITION RELEASE */
  22. /* */
  23. /* fx_system.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 system constants and global data */
  32. /* definitions, including external references. It is assumed that */
  33. /* fx_api.h (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_SYSTEM_H
  45. #define FX_SYSTEM_H
  46. /* Define System component constants. */
  47. #define FX_TIMER_ID ((ULONG) 0x46585359)
  48. /* Define the external System component function prototypes. */
  49. VOID _fx_system_initialize(VOID);
  50. UINT _fx_system_date_set(UINT year, UINT month, UINT day);
  51. UINT _fx_system_time_set(UINT hour, UINT minute, UINT second);
  52. UINT _fx_system_date_get(UINT *year, UINT *month, UINT *day);
  53. UINT _fx_system_time_get(UINT *hour, UINT *minute, UINT *second);
  54. VOID _fx_system_timer_entry(ULONG id);
  55. UINT _fxe_system_date_set(UINT year, UINT month, UINT day);
  56. UINT _fxe_system_time_set(UINT hour, UINT minute, UINT second);
  57. UINT _fxe_system_date_get(UINT *year, UINT *month, UINT *day);
  58. UINT _fxe_system_time_get(UINT *hour, UINT *minute, UINT *second);
  59. /* System Component data declarations follow. */
  60. /* Determine if the initialization function of this component is including
  61. this file. If so, make the data definitions really happen. Otherwise,
  62. make them extern so other functions in the component can access them. */
  63. #ifdef FX_SYSTEM_INIT
  64. #define SYSTEM_DECLARE
  65. #else
  66. #define SYSTEM_DECLARE extern
  67. #endif
  68. /* Define the head pointer of the opened media list. */
  69. SYSTEM_DECLARE FX_MEDIA *_fx_system_media_opened_ptr;
  70. /* Define the variable that holds the number of open media. */
  71. SYSTEM_DECLARE ULONG _fx_system_media_opened_count;
  72. /* Define the system date variable. */
  73. SYSTEM_DECLARE UINT _fx_system_date;
  74. /* Define the system time variable. */
  75. SYSTEM_DECLARE UINT _fx_system_time;
  76. /* Define the variable that holds the maximum size of the sector cache. */
  77. SYSTEM_DECLARE ULONG _fx_system_media_max_sector_cache;
  78. /* Define the variable that holds the maximum size of the FAT cache. */
  79. SYSTEM_DECLARE ULONG _fx_system_media_max_fat_cache;
  80. /* Define the global FileX build options variables. These variables contain a bit
  81. map representing how the FileX library was built. The following are the bit
  82. field definitions:
  83. _fx_system_build_options_1:
  84. Bit(s) Meaning
  85. 31-24 FX_MAX_LONG_NAME_LEN
  86. 23-16 FX_MAX_LAST_NAME_LEN
  87. 15-11 Reserved
  88. 10 FX_NO_TIMER defined
  89. 9 FX_SINGLE_THREAD defined
  90. 8 FX_DONT_UPDATE_OPEN_FILES defined
  91. 7 FX_MEDIA_DISABLE_SEARCH_CACHE defined
  92. 6 FX_MEDIA_STATISTICS_DISABLE defined
  93. 5 Reserved
  94. 4 FX_SINGLE_OPEN_LEGACY defined
  95. 3 FX_RENAME_PATH_INHERIT defined
  96. 2 FX_NO_LOCAL_PATH defined
  97. 1 FX_FAULT_TOLERANT_DATA defined
  98. 0 FX_FAULT_TOLERANT defined
  99. _fx_system_build_options_2:
  100. Bit(s) Meaning
  101. 31-16 FX_MAX_SECTOR_CACHE
  102. 15-8 FX_FAT_MAP_SIZE
  103. 7-0 FX_MAX_FAT_CACHE
  104. _fx_system_build_options_3:
  105. Bit(s) Meaning
  106. 31-24 Reserved
  107. 23-16 FX_UPDATE_RATE_IN_SECONDS
  108. 15-0 FX_UPDATE_RATE_IN_TICKS
  109. Note that values greater than the value that can be represented in the build options
  110. bit field are represented as all ones in the bit field. For example, if FX_MAX_LONG_NAME_LEN
  111. is 256, the value in the bits 31-24 of _fx_system_build_options_1 is 0xFF, which is 255
  112. decimal. */
  113. SYSTEM_DECLARE ULONG _fx_system_build_options_1;
  114. SYSTEM_DECLARE ULONG _fx_system_build_options_2;
  115. SYSTEM_DECLARE ULONG _fx_system_build_options_3;
  116. /* Define system timer control block. If accurate date/time stamps on
  117. files is not needed, the define FX_NO_TIMER should be used when
  118. compiling fx_system_initialize.c to eliminate the FileX timer. */
  119. #ifndef FX_NO_TIMER
  120. SYSTEM_DECLARE TX_TIMER _fx_system_timer;
  121. #endif
  122. #endif