Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
3.6 KiB

  1. /*--------------------------------------------------------------------------
  2. *
  3. * Copyright (C) Cyclades Corporation, 1997-2001.
  4. * All rights reserved.
  5. *
  6. * Cyclades-Z Enumerator Driver
  7. *
  8. * This file: cyzload.h
  9. *
  10. * Description: Cyclades-Z Firmware Loader Header
  11. *
  12. * Notes: This code supports Windows 2000 and Windows XP,
  13. * x86 and ia64 processors.
  14. *
  15. * Complies with Cyclades SW Coding Standard rev 1.3.
  16. *
  17. *--------------------------------------------------------------------------
  18. */
  19. /*-------------------------------------------------------------------------
  20. *
  21. * Change History
  22. *
  23. *--------------------------------------------------------------------------
  24. *
  25. *
  26. *--------------------------------------------------------------------------
  27. */
  28. /* Include some standard header files. These are used ONLY to support the
  29. ** open/close/read/write macros listed below, as well as the size_t typedef.
  30. */
  31. // include of standard header files deleted for NT
  32. //#include <stdio.h>
  33. //#include <stdlib.h>
  34. /* This is an arbitrary data type that is passed to the copy functions. It
  35. ** serves no function inside z_load, except as a way to identify the board
  36. ** to the copy functions. The data type of Z_BOARD_IDENT can be changed
  37. ** at port time to support the particular implimentation.
  38. */
  39. typedef PFDO_DEVICE_DATA Z_BOARD_IDENT;
  40. /* A standard 32 bit unsigned integer */
  41. //removed in W2K typedef unsigned long UINT32;
  42. /* These are some misc functions that z_load() requires. They have been
  43. ** made into macros to help in the porting process. These macros are
  44. ** equivalent to:
  45. **
  46. ** Z_STREAM *zl_open (char *path);
  47. ** int zl_close (Z_STREAM);
  48. ** int zl_fread (void *ptr, size_t size, int count, Z_STREAM *stream);
  49. ** int zl_fwrite (void *ptr, size_t size, int count, Z_STREAM *stream);
  50. ** int zl_fseek (Z_STREAM *stream, unsigned long offset);
  51. */
  52. typedef HANDLE Z_STREAM;
  53. #define zl_min(aaa,bbb) (((aaa)<(bbb))?(aaa):(bbb))
  54. #ifndef NULL
  55. #define NULL ((void *)(0UL))
  56. #endif
  57. /* This defined the size of the buffer used in copying data. This can be
  58. ** any power of two.
  59. */
  60. #define ZBUF_SIZE (256)
  61. /* The loader can use static (read, "Permanent") buffers, or use the stack.
  62. ** Define this if the stack should be used. If #undef'd, then permanent
  63. ** static buffers will be used.
  64. */
  65. #define ZBUF_STACK
  66. #define ZL_MAX_BLOCKS (16)
  67. #define ZL_RET_SUCCESS 0
  68. #define ZL_RET_NO_MATCHING_FW_CONFIG 1
  69. #define ZL_RET_FILE_OPEN_ERROR 2
  70. #define ZL_RET_FPGA_ERROR 3
  71. #define ZL_RET_FILE_READ_ERROR 4
  72. struct ZFILE_HEADER
  73. {
  74. char name[64];
  75. char date[32];
  76. char aux[32];
  77. UINT32 n_config; /* The number of configurations in this file */
  78. UINT32 config_offset; /* The file offset to the ZFILE_CONFIG array */
  79. UINT32 n_blocks; /* The number of data blocks in this file */
  80. UINT32 block_offset; /* The offset for the ZFILE_BLOCK array */
  81. UINT32 reserved[9]; /* Reserved for future use */
  82. };
  83. struct ZFILE_CONFIG
  84. {
  85. char name[64];
  86. UINT32 mailbox;
  87. UINT32 function;
  88. UINT32 n_blocks;
  89. UINT32 block_list[ZL_MAX_BLOCKS];
  90. };
  91. struct ZFILE_BLOCK
  92. {
  93. UINT32 type;
  94. UINT32 file_offset;
  95. UINT32 ram_offset;
  96. UINT32 size;
  97. };
  98. enum ZBLOCK_TYPE {ZBLOCK_PRG, ZBLOCK_FPGA};
  99. enum ZFUNCTION_TYPE {ZFUNCTION_NORMAL, ZFUNCTION_TEST, ZFUNCTION_DIAG};
  100. //CYZLOAD.C
  101. int
  102. z_load (
  103. Z_BOARD_IDENT board,
  104. UINT32 function,
  105. PCWSTR filename
  106. );
  107. VOID
  108. z_reset_board(
  109. Z_BOARD_IDENT board
  110. );
  111. VOID
  112. z_stop_cpu(
  113. Z_BOARD_IDENT board
  114. );
  115. int
  116. z_fpga_check(
  117. Z_BOARD_IDENT board
  118. );
  119.