analysisOfLiquidLevelDataOperation.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * ARC firmware interface defines.
  7. *
  8. * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
  9. * Copyright (C) 1999, 2001 Ralf Baechle (ralf@gnu.org)
  10. * Copyright (C) 1999 Silicon Graphics, Inc.
  11. */
  12. #ifndef _ASM_SGIARCS_H
  13. #define _ASM_SGIARCS_H
  14. #include <asm/types.h>
  15. #include <asm/fw/arc/types.h>
  16. /* Various ARCS error codes. */
  17. #define PROM_ESUCCESS 0x00
  18. #define PROM_E2BIG 0x01
  19. #define PROM_EACCESS 0x02
  20. #define PROM_EAGAIN 0x03
  21. #define PROM_EBADF 0x04
  22. #define PROM_EBUSY 0x05
  23. #define PROM_EFAULT 0x06
  24. #define PROM_EINVAL 0x07
  25. #define PROM_EIO 0x08
  26. #define PROM_EISDIR 0x09
  27. #define PROM_EMFILE 0x0a
  28. #define PROM_EMLINK 0x0b
  29. #define PROM_ENAMETOOLONG 0x0c
  30. #define PROM_ENODEV 0x0d
  31. #define PROM_ENOENT 0x0e
  32. #define PROM_ENOEXEC 0x0f
  33. #define PROM_ENOMEM 0x10
  34. #define PROM_ENOSPC 0x11
  35. #define PROM_ENOTDIR 0x12
  36. #define PROM_ENOTTY 0x13
  37. #define PROM_ENXIO 0x14
  38. #define PROM_EROFS 0x15
  39. /* SGI ARCS specific errno's. */
  40. #define PROM_EADDRNOTAVAIL 0x1f
  41. #define PROM_ETIMEDOUT 0x20
  42. #define PROM_ECONNABORTED 0x21
  43. #define PROM_ENOCONNECT 0x22
  44. /* Device classes, types, and identifiers for prom
  45. * device inventory queries.
  46. */
  47. enum linux_devclass {
  48. system, processor, cache, adapter, controller, peripheral, memory
  49. };
  50. enum linux_devtypes {
  51. /* Generic stuff. */
  52. Arc, Cpu, Fpu,
  53. /* Primary insn and data caches. */
  54. picache, pdcache,
  55. /* Secondary insn, data, and combined caches. */
  56. sicache, sdcache, sccache,
  57. memdev, eisa_adapter, tc_adapter, scsi_adapter, dti_adapter,
  58. multifunc_adapter, dsk_controller, tp_controller, cdrom_controller,
  59. worm_controller, serial_controller, net_controller, disp_controller,
  60. parallel_controller, ptr_controller, kbd_controller, audio_controller,
  61. misc_controller, disk_peripheral, flpy_peripheral, tp_peripheral,
  62. modem_peripheral, monitor_peripheral, printer_peripheral,
  63. ptr_peripheral, kbd_peripheral, term_peripheral, line_peripheral,
  64. net_peripheral, misc_peripheral, anon
  65. };
  66. enum linux_identifier {
  67. bogus, ronly, removable, consin, consout, input, output
  68. };
  69. /* A prom device tree component. */
  70. struct linux_component {
  71. enum linux_devclass class; /* node class */
  72. enum linux_devtypes type; /* node type */
  73. enum linux_identifier iflags; /* node flags */
  74. USHORT vers; /* node version */
  75. USHORT rev; /* node revision */
  76. ULONG key; /* completely magic */
  77. ULONG amask; /* XXX affinity mask??? */
  78. ULONG cdsize; /* size of configuration data */
  79. ULONG ilen; /* length of string identifier */
  80. _PULONG iname; /* string identifier */
  81. };
  82. typedef struct linux_component pcomponent;
  83. struct linux_sysid {
  84. char vend[8], prod[8];
  85. };
  86. /* ARCS prom memory descriptors. */
  87. enum arcs_memtypes {
  88. arcs_eblock, /* exception block */
  89. arcs_rvpage, /* ARCS romvec page */
  90. arcs_fcontig, /* Contiguous and free */
  91. arcs_free, /* Generic free memory */
  92. arcs_bmem, /* Borken memory, don't use */
  93. arcs_prog, /* A loaded program resides here */
  94. arcs_atmp, /* ARCS temporary storage area, wish Sparc OpenBoot told this */
  95. arcs_aperm, /* ARCS permanent storage... */
  96. };
  97. /* ARC has slightly different types than ARCS */
  98. enum arc_memtypes {
  99. arc_eblock, /* exception block */
  100. arc_rvpage, /* romvec page */
  101. arc_free, /* Generic free memory */
  102. arc_bmem, /* Borken memory, don't use */
  103. arc_prog, /* A loaded program resides here */
  104. arc_atmp, /* temporary storage area */
  105. arc_aperm, /* permanent storage */
  106. arc_fcontig, /* Contiguous and free */
  107. };
  108. union linux_memtypes {
  109. enum arcs_memtypes arcs;
  110. enum arc_memtypes arc;
  111. };
  112. struct linux_mdesc {
  113. union linux_memtypes type;
  114. ULONG base;
  115. ULONG pages;
  116. };
  117. /* Time of day descriptor. */
  118. struct linux_tinfo {
  119. unsigned short yr;
  120. unsigned short mnth;
  121. unsigned short day;
  122. unsigned short hr;
  123. unsigned short min;
  124. unsigned short sec;
  125. unsigned short msec;
  126. };
  127. /* ARCS virtual dirents. */
  128. struct linux_vdirent {
  129. ULONG namelen;
  130. unsigned char attr;
  131. char fname[32]; /* XXX imperical, should be a define */
  132. };
  133. /* Other stuff for files. */
  134. enum linux_omode {
  135. rdonly, wronly, rdwr, wronly_creat, rdwr_creat,
  136. wronly_ssede, rdwr_ssede, dirent, dirent_creat
  137. };
  138. enum linux_seekmode {
  139. absolute, relative
  140. };
  141. enum linux_mountops {
  142. media_load, media_unload
  143. };
  144. /* This prom has a bolixed design. */
  145. struct linux_bigint {
  146. #ifdef __MIPSEL__
  147. u32 lo;
  148. s32 hi;
  149. #else /* !(__MIPSEL__) */
  150. s32 hi;
  151. u32 lo;
  152. #endif
  153. };
  154. struct linux_finfo {
  155. struct linux_bigint begin;
  156. struct linux_bigint end;
  157. struct linux_bigint cur;
  158. enum linux_devtypes dtype;
  159. unsigned long namelen;
  160. unsigned char attr;
  161. char name[32]; /* XXX imperical, should be define */
  162. };
  163. /* This describes the vector containing function pointers to the ARC
  164. firmware functions. */
  165. struct linux_romvec {
  166. LONG load; /* Load an executable image. */
  167. LONG invoke; /* Invoke a standalong image. */
  168. LONG exec; /* Load and begin execution of a
  169. standalone image. */
  170. LONG halt; /* Halt the machine. */
  171. LONG pdown; /* Power down the machine. */
  172. LONG restart; /* XXX soft reset??? */
  173. LONG reboot; /* Reboot the machine. */
  174. LONG imode; /* Enter PROM interactive mode. */
  175. LONG _unused1; /* Was ReturnFromMain(). */
  176. /* PROM device tree interface. */
  177. LONG next_component;
  178. LONG child_component;
  179. LONG parent_component;
  180. LONG component_data;
  181. LONG child_add;
  182. LONG comp_del;
  183. LONG component_by_path;
  184. /* Misc. stuff. */
  185. LONG cfg_save;
  186. LONG get_sysid;
  187. /* Probing for memory. */
  188. LONG get_mdesc;
  189. LONG _unused2; /* was Signal() */
  190. LONG get_tinfo;
  191. LONG get_rtime;
  192. /* File type operations. */
  193. LONG get_vdirent;
  194. LONG open;
  195. LONG close;
  196. LONG read;
  197. LONG get_rstatus;
  198. LONG write;
  199. LONG seek;
  200. LONG mount;
  201. /* Dealing with firmware environment variables. */
  202. LONG get_evar;
  203. LONG set_evar;
  204. LONG get_finfo;
  205. LONG set_finfo;
  206. /* Miscellaneous. */
  207. LONG cache_flush;
  208. LONG TestUnicodeCharacter; /* ARC; not sure if ARCS too */
  209. LONG GetDisplayStatus;
  210. };
  211. /* The SGI ARCS parameter block is in a fixed location for standalone
  212. * programs to access PROM facilities easily.