cfe_api_int.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. * Copyright (C) 2000, 2001, 2002 Broadcom Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #ifndef CFE_API_INT_H
  19. #define CFE_API_INT_H
  20. /*
  21. * Constants.
  22. */
  23. #define CFE_CMD_FW_GETINFO 0
  24. #define CFE_CMD_FW_RESTART 1
  25. #define CFE_CMD_FW_BOOT 2
  26. #define CFE_CMD_FW_CPUCTL 3
  27. #define CFE_CMD_FW_GETTIME 4
  28. #define CFE_CMD_FW_MEMENUM 5
  29. #define CFE_CMD_FW_FLUSHCACHE 6
  30. #define CFE_CMD_DEV_GETHANDLE 9
  31. #define CFE_CMD_DEV_ENUM 10
  32. #define CFE_CMD_DEV_OPEN 11
  33. #define CFE_CMD_DEV_INPSTAT 12
  34. #define CFE_CMD_DEV_READ 13
  35. #define CFE_CMD_DEV_WRITE 14
  36. #define CFE_CMD_DEV_IOCTL 15
  37. #define CFE_CMD_DEV_CLOSE 16
  38. #define CFE_CMD_DEV_GETINFO 17
  39. #define CFE_CMD_ENV_ENUM 20
  40. #define CFE_CMD_ENV_GET 22
  41. #define CFE_CMD_ENV_SET 23
  42. #define CFE_CMD_ENV_DEL 24
  43. #define CFE_CMD_MAX 32
  44. #define CFE_CMD_VENDOR_USE 0x8000 /* codes above this are for customer use */
  45. /*
  46. * Structures.
  47. */
  48. /* eeek, signed "pointers" */
  49. typedef s64 cfe_xptr_t;
  50. struct xiocb_buffer {
  51. u64 buf_offset; /* offset on device (bytes) */
  52. cfe_xptr_t buf_ptr; /* pointer to a buffer */
  53. u64 buf_length; /* length of this buffer */
  54. u64 buf_retlen; /* returned length (for read ops) */
  55. u64 buf_ioctlcmd; /* IOCTL command (used only for IOCTLs) */
  56. };
  57. struct xiocb_inpstat {
  58. u64 inp_status; /* 1 means input available */
  59. };
  60. struct xiocb_envbuf {
  61. s64 enum_idx; /* 0-based enumeration index */
  62. cfe_xptr_t name_ptr; /* name string buffer */
  63. s64 name_length; /* size of name buffer */
  64. cfe_xptr_t val_ptr; /* value string buffer */
  65. s64 val_length; /* size of value string buffer */
  66. };
  67. struct xiocb_cpuctl {
  68. u64 cpu_number; /* cpu number to control */
  69. u64 cpu_command; /* command to issue to CPU */
  70. u64 start_addr; /* CPU start address */
  71. u64 gp_val; /* starting GP value */
  72. u64 sp_val; /* starting SP value */
  73. u64 a1_val; /* starting A1 value */
  74. };
  75. struct xiocb_time {
  76. s64 ticks; /* current time in ticks */
  77. };
  78. struct xiocb_exitstat{
  79. s64 status;
  80. };
  81. struct xiocb_meminfo {
  82. s64 mi_idx; /* 0-based enumeration index */
  83. s64 mi_type; /* type of memory block */
  84. u64 mi_addr; /* physical start address */
  85. u64 mi_size; /* block size */
  86. };
  87. struct xiocb_fwinfo {
  88. s64 fwi_version; /* major, minor, eco version */
  89. s64 fwi_totalmem; /* total installed mem */
  90. s64 fwi_flags; /* various flags */
  91. s64 fwi_boardid; /* board ID */
  92. s64 fwi_bootarea_va; /* VA of boot area */
  93. s64 fwi_bootarea_pa; /* PA of boot area */
  94. s64 fwi_bootarea_size; /* size of boot area */
  95. s64 fwi_reserved1;
  96. s64 fwi_reserved2;
  97. s64 fwi_reserved3;
  98. };
  99. struct cfe_xiocb {
  100. u64 xiocb_fcode; /* IOCB function code */
  101. s64 xiocb_status; /* return status */
  102. s64 xiocb_handle; /* file/device handle */
  103. u64 xiocb_flags; /* flags for this IOCB */
  104. u64 xiocb_psize; /* size of parameter list */
  105. union {
  106. /* buffer parameters */
  107. struct xiocb_buffer xiocb_buffer;
  108. /* input status parameters */
  109. struct xiocb_inpstat xiocb_inpstat;
  110. /* environment function parameters */
  111. struct xiocb_envbuf xiocb_envbuf;
  112. /* CPU control parameters */
  113. struct xiocb_cpuctl xiocb_cpuctl;
  114. /* timer parameters */
  115. struct xiocb_time xiocb_time;
  116. /* memory arena info parameters */
  117. struct xiocb_meminfo xiocb_meminfo;
  118. /* firmware information */
  119. struct xiocb_fwinfo xiocb_fwinfo;
  120. /* Exit Status */
  121. struct xiocb_exitstat xiocb_exitstat;
  122. } plist;
  123. };
  124. #endif /* CFE_API_INT_H */