home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / DISKU332.LZH / DISKUS.332 / TC63CPX / TCACHE.H < prev    next >
C/C++ Source or Header  |  1995-10-29  |  7KB  |  295 lines

  1. #ifndef TCACHE__INCLUDED
  2. #define TCACHE__INCLUDED
  3. #include <tos.h>
  4.  
  5. /* Anzahl der möglichen Laufwerke */
  6. /* Wenn Änderung, dann auch bei virtuellen Laufwerken nötig */
  7. #define MAXDRV        32
  8.  
  9. /* Anzahl der von TCache aktiv unterstützten Lw */
  10. #define MAXAKTIV  16
  11.  
  12. /* benötigte Strukturen zur Parameterübergabe an TCache>=5.6 */
  13.  
  14. /* Parameterblock für Funktion RBCache 815 */
  15. typedef struct CACHEDATA
  16. {
  17.     int aktiv;
  18.     int led;
  19.     int memory;
  20.     int hash_bits;
  21.     int max_secs_read;
  22.     int max_secs_write;
  23.     int max_prefetch;
  24.     int delay_time;
  25.     int full;
  26.     int percent;
  27.     int locked; /* neu ab 6.3 */
  28. }
  29. CACHEDATA;
  30.  
  31. /* Unterstruktur für RBInformation */
  32. /* Das ist der Teil, der auch geschrieben werden kann */
  33. typedef struct DRIVEDATA
  34. {
  35.     int prefetch;
  36.     char cache_aktiv;
  37.     char mediach;
  38.     int write_aktiv;
  39.     int delayed_aktiv;
  40.     int write_protect;
  41.     int calculate;
  42.     int fat;
  43. }
  44. DRIVEDATA;
  45.  
  46. /* Parameter für Funktion RBInformation 816 */
  47. typedef struct INFODATA
  48. {
  49.     long reads;
  50.     long read_hits;
  51.     long writes;
  52.     long write_hits;
  53.     long errors;
  54.     long odd;
  55.     int recsize;
  56.     DRIVEDATA data;
  57. }
  58. INFODATA;
  59.  
  60. /* Parameter für RBHide 821 */
  61. typedef struct HIDEDATA
  62. {
  63.     long passwort;
  64.     int drives[MAXDRV];
  65. }
  66. HIDEDATA;
  67.  
  68. /* Parameter für RBDrvA 822 */
  69. typedef char DRVADATA[MAXDRV];
  70.  
  71. /* Parameter für RBRam 823 */
  72. typedef struct RBRAMDATA
  73. {
  74.     int ram_drv;
  75.     int ram_ok;
  76.     BPB ram_bpb;
  77.     int ram_mem;
  78.     long *ram_ptr;
  79.     BASPAG *base_page;
  80.     char resetfest;
  81.     char reserved;
  82. }
  83. RBRAMDATA;
  84.  
  85. /* Parameter für RBDefRamDrv 836 */
  86. typedef struct RBRAMDEFDATA
  87. {
  88.     int ram_drv;
  89.     int ram_size;
  90. }
  91. RBRAMDEFDATA;
  92.  
  93. /* Parameter für RBAbortFehler 839 */
  94. typedef struct RBFEHLERLOC
  95. {
  96.     int fehler_drv;
  97.     long fehler_sec;
  98. }
  99. RBFEHLERLOC;
  100.  
  101. /* Parameter für RBGetFehler 838 */
  102. typedef struct RBFEHLERDATA
  103. {
  104.     int fehler_nummer;
  105.     RBFEHLERLOC fehler_loc;
  106. }
  107. RBFEHLERDATA;
  108.  
  109. /* Parameter für RBMore 841 */
  110. typedef struct RBMOREDATA
  111. {
  112.     long abs_read;
  113.     long abs_write;
  114.     long write_error;
  115.     long einzelsektor;
  116.     long multisektor;
  117.     long total;
  118.     long saved;
  119.     long reserved[10]; /* bis 6.2 */
  120. }
  121. RBMOREDATA;
  122.  
  123. /* Cookie-Funktionen von TCache */
  124. /* Tcache installiert? */
  125. #define TCache_There (call_tcache!=(void*)0)
  126.  
  127. /* Zeiger auf Routinen */
  128. long cdecl (*call_tcache)(int,...);
  129.  
  130.  
  131. #ifdef TEST
  132. extern long cdecl do_deb_tcache(int,...);
  133. #define Do_Call_tcache do_deb_tcache
  134. #else
  135. /* externes Modul, das die Register sichert */
  136. extern long cdecl do_call_tcache(int,...);
  137. #define Do_Call_tcache do_call_tcache
  138. #endif
  139.  
  140. /* jetzt folgen alle Cookie-Funktionsnummern */
  141. #define RBCacheN                815
  142. #define RBInformationN    816
  143. #define RBSaveN                    817
  144. #define RBLockN                    818
  145. #define RBFlushN                 819
  146. #define RBClrN                    820
  147. #define RBHideN                    821
  148. #define RBDrvAN                    822
  149. #define RBRamN                    823
  150. #define RBUhrN                    824
  151. #define RBGemdosN                825
  152. #define RBAccN                    826
  153. #define RBMemN                    827
  154. #define RBCacheHitN            828
  155. #define RBWriteN                828
  156. #define RBFlush_etvN        829
  157. #define RBStepN                    830
  158. #define RBVirtuellN            831
  159. #define RBXBRAchecN            832
  160. #define RBDrvbitcheckN    833
  161. #define RBPun_InfoN            834
  162. #define RBNoxN                    835
  163. #define RBDefRamDrvN        836
  164. #define RBStopN                    837
  165. #define RBGetFehlerN        838
  166. #define RBAbortFehlerN    839
  167. #define RBAbsolutN            840
  168. #define RBMoreN                    841
  169. #define RBFlush_allN        842
  170. #define RBSektor_testN    843
  171. #define RBBoot_writeN        844
  172. #define RBLRUN                    845
  173. #define RBDeldelayedN        846
  174. #define RBTurboN                847
  175.  
  176. #define RBTestingN         997
  177. #define RBInstalledN    998
  178. #define RBFmediachN        999
  179. /* jetzt fertige Cookie-Funktionsaufrufe */
  180. #define RBCache(flag,dataptr)\
  181.     ((int(*)(int,int,CACHEDATA*))Do_Call_tcache)(RBCacheN,flag,dataptr)
  182.  
  183. #define RBInformation(drv,flag,data)\
  184.     ((void(*)(int,int,int,INFODATA*))Do_Call_tcache)(RBInformationN,drv,flag,data);
  185.  
  186. #define RBSave(name)\
  187.     ((int(*)(int,char *))Do_Call_tcache)(RBSaveN,name)
  188.  
  189. #define RBLock(status)\
  190.     ((int(*)(int,int))Do_Call_tcache)(RBLockN,status)
  191.  
  192. #define RBFlush()\
  193.     ((void(*)(int))Do_Call_tcache)(RBFlushN)
  194.  
  195. #define RBClr()\
  196.     ((void(*)(int))Do_Call_tcache)(RBClrN)
  197.  
  198. #define RBHide(flag,data)\
  199.     ((void(*)(int,int,HIDEDATA*))Do_Call_tcache)(RBHideN,flag,data)
  200.  
  201. #define RBDrvA(flag,data)\
  202.     ((void(*)(int,int,DRVADATA))Do_Call_tcache)(RBDrvAN,flag,data)
  203.  
  204. #define RBRam(flag,data)\
  205.     ((void(*)(int,int,RBRAMDATA*))Do_Call_tcache)(RBRamN,flag,data)
  206.  
  207. #define RBUhr(status)\
  208.     ((int(*)(int,int))Do_Call_tcache)(RBUhrN,status)
  209.  
  210. #define RBGemdos(status)\
  211.     ((int(*)(int,int))Do_Call_tcache)(RBGemdosN,status)
  212.  
  213. #define RBAcc(status,name)\
  214.     ((int(*)(int,int,char*))Do_Call_tcache)(RBAccN,status,name)
  215.  
  216. #define RBMem()\
  217.     ((long(*)(int))Do_Call_tcache)(RBMemN)
  218.  
  219. #define RBCacheHit(status)\
  220.     ((int(*)(int,int))Do_Call_tcache)(RBCacheHitN,status)
  221.  
  222. #define RBWrite(status)\
  223.     ((int(*)(int,int))Do_Call_tcache)(RBWriteN,status)
  224.  
  225. #define RBFlush_etv(status)\
  226.     ((int(*)(int,int))Do_Call_tcache)(RBFlush_etvN,status)
  227.  
  228. #define RBStep(status,stellen,raten)\
  229.     ((int(*)(int,int,int,int*))Do_Call_tcache)(RBStepN,status,stellen,raten)
  230.  
  231. #define RBVirtuell(virtmap)\
  232.     ((unsigned int (*)(int,long))Do_Call_tcache)(RBVirtuellN,virtmap)
  233.  
  234. #define RBXBracheck(status)\
  235.     ((int(*)(int,int))Do_Call_tcache)(RBXBRAchecN,status)
  236.  
  237. #define RBDrvbitcheck(status)\
  238.     ((int(*)(int,int))Do_Call_tcache)(RBDrvbitcheckN,status)
  239.  
  240. #define RBInstalled()\
  241.     ((int(*)(int))Do_Call_tcache)(RBInstalledN)
  242.  
  243. #define RBFmediach(drive)\
  244.     ((void(*)(int,int))Do_Call_tcache)(RBFmediachN,drive)
  245.  
  246. #define RBPun_Info(status)\
  247.     ((int(*)(int,int))Do_Call_tcache)(RBPun_InfoN,status)
  248.  
  249. #define RBNox(status)\
  250.     ((int(*)(int,int))Do_Call_tcache)(RBNoxN,status)
  251.  
  252. #define RBDefRamDrv(flag,data)\
  253.     ((void(*)(int,int,RBRAMDEFDATA*))Do_Call_tcache)\
  254.                 (RBDefRamDrvN,flag,data)
  255.  
  256. #define RBStop(flag)\
  257.     ((int(*)(int,int))Do_Call_tcache)(RBStopN,flag)
  258.  
  259. #define RBGetFehler(data)\
  260.     ((void(*)(int,RBFEHLERDATA*))Do_Call_tcache)\
  261.                 (RBGetFehlerN,data)
  262.  
  263. #define RBAbortFehler(data)\
  264.     ((void(*)(int,RBFEHLERLOC*))Do_Call_tcache)\
  265.                 (RBAbortFehlerN,data)
  266.  
  267. #define RBAbsolut(flag)\
  268.     ((int(*)(int,int))Do_Call_tcache)(RBAbsolutN,flag)
  269.  
  270. #define RBMore(data)\
  271.     ((void(*)(int,RBMOREDATA*))Do_Call_tcache)(RBMoreN,data)
  272.  
  273. #define RBTesting(flag)\
  274.     ((int(*)(int))Do_Call_tcache)(RBTestingN,flag)
  275.  
  276. #define RBFlush_all(flag)\
  277.     ((int(*)(int,int))Do_Call_tcache)(RBFlush_allN,flag)
  278.  
  279. #define RBSektor_test(flag)\
  280.     ((int(*)(int,int))Do_Call_tcache)(RBSektor_testN,flag)
  281.  
  282. #define RBBoot_write(flag)\
  283.     ((int(*)(int,int))Do_Call_tcache)(RBBoot_writeN,flag)
  284.  
  285. #define RBLRU(flag)\
  286.     ((int(*)(int,int))Do_Call_tcache)(RBLRUN,flag)
  287.  
  288. #define RBDeldelayed(flag)\
  289.     ((int(*)(int,int))Do_Call_tcache)(RBDeldelayedN,flag)
  290.  
  291. #define RBTurbo(flag)\
  292.     ((int(*)(int,int))Do_Call_tcache)(RBTurboN,flag)
  293.  
  294. #endif /* TCACHE__INCLUDED */
  295.