2
0

BIOS.Adaptec7Script.Mod 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. (* ETH Oberon, Copyright 2001 ETH Zuerich Institut fuer Computersysteme, ETH Zentrum, CH-8092 Zuerich.
  2. Refer to the "General ETH Oberon System Source License" contract available at: http://www.oberon.ethz.ch/ *)
  3. MODULE Adaptec7Script; (** AUTHOR "prk"; PURPOSE "Adaptec 7xxx SCSI firmware"; *)
  4. (*
  5. Script for the Adaptec 7xxx sequencer.
  6. Taken from Linux (Version 5.1.15/3.2.4)
  7. Ported by Patrik Reali (reali@acm.org), 30.3.99
  8. 04.08.99:
  9. bug in GetLine. Caused some lines to be skipped on the AHA2940A
  10. 29.07.99:
  11. Scripts for rapid file conversion
  12. porting 5.1.15
  13. *)
  14. IMPORT
  15. SYSTEM;
  16. TYPE
  17. Patch = RECORD f, begin, skipinstr, skippatch: LONGINT END;
  18. VAR
  19. Patches: ARRAY 77 OF Patch;
  20. F: ARRAY 14 OF BOOLEAN;
  21. Base: ADDRESS; (* pointer to the program *)
  22. pc, patch: LONGINT;
  23. PROCEDURE CorrectAddr(VAR line: SET);
  24. VAR i, addr, Max: LONGINT;
  25. BEGIN
  26. addr := SYSTEM.VAL(LONGINT, LSH(line*{17..26}, -17));
  27. i := 0; Max := addr;
  28. WHILE Patches[i].begin < Max DO
  29. IF ~F[Patches[i].f] THEN (*patch not active*)
  30. addr := addr - Patches[i].skipinstr;
  31. INC(i, Patches[i].skippatch)
  32. ELSE
  33. INC(i)
  34. END
  35. END;
  36. line := line - {17..26} + SYSTEM.VAL(SET, LSH(addr, 17));
  37. END CorrectAddr;
  38. PROCEDURE LoadPatches;
  39. VAR i: LONGINT;
  40. PROCEDURE SetPatch(func, line, skipadr, skippatch: LONGINT);
  41. BEGIN
  42. Patches[i].f := func;
  43. Patches[i].begin := line;
  44. Patches[i].skipinstr := skipadr;
  45. Patches[i].skippatch := skippatch;
  46. INC(i)
  47. END SetPatch;
  48. BEGIN
  49. i := 0;
  50. SetPatch(1 , 2, 1, 2); SetPatch(0 , 3, 1, 1); SetPatch(2 , 4, 2, 1); SetPatch(3 , 8, 1, 1);
  51. SetPatch(3 , 9, 1, 1); SetPatch(4 , 12, 4, 1); SetPatch(5 , 17, 3, 2); SetPatch(0 , 20, 4, 1);
  52. SetPatch(6 , 24, 1, 1); SetPatch(7 , 27, 1, 1); SetPatch(2 , 30, 1, 2); SetPatch(0 , 31, 3, 1);
  53. SetPatch(4 , 40, 4, 1); SetPatch(8 , 44, 3, 2); SetPatch(0 , 47, 3, 1); SetPatch(9 , 52, 7, 1);
  54. SetPatch(4 , 60, 3, 1); SetPatch(8 , 63, 2, 1); SetPatch(1 , 68, 60, 1); SetPatch(8 , 162, 1, 2);
  55. SetPatch(0 , 163, 2, 1); SetPatch(2 , 167, 2, 3); SetPatch(8 , 167, 1, 1); SetPatch(0 , 169, 2, 1);
  56. SetPatch(8 , 172, 1, 2); SetPatch(0 , 173, 1, 1); SetPatch(2 , 177, 1, 1); SetPatch(2 , 180, 3, 2);
  57. SetPatch(0 , 183, 5, 1); SetPatch(2 , 191, 2, 3); SetPatch(8 , 191, 1, 1); SetPatch(0 , 193, 3, 1);
  58. SetPatch(10 , 196, 2, 1); SetPatch(8 , 198, 7, 2); SetPatch(0 , 205, 1, 1); SetPatch(2 , 210, 14, 3);
  59. SetPatch(10 , 223, 1, 1); SetPatch(0 , 224, 9, 1); SetPatch(8 , 238, 2, 1); SetPatch(8 , 240, 1, 1);
  60. SetPatch(10 , 241, 6, 3); SetPatch(2 , 241, 2, 2); SetPatch(0 , 243, 4, 1); SetPatch(8 , 248, 1, 1);
  61. SetPatch(8 , 252, 11, 1); SetPatch(2 , 264, 3, 3); SetPatch(10 , 266, 1, 1); SetPatch(0 , 267, 5, 1);
  62. SetPatch(10 , 272, 1, 2); SetPatch(0 , 273, 7, 1); SetPatch(11 , 287, 1, 2); SetPatch(0 , 288, 1, 1);
  63. SetPatch(5 , 348, 1, 2); SetPatch(0 , 349, 1, 1); SetPatch(3 , 352, 1, 1); SetPatch(2 , 362, 3, 2);
  64. SetPatch(0 , 365, 5, 1); SetPatch(11 , 373, 1, 2); SetPatch(0 , 374, 1, 1); SetPatch(6 , 379, 1, 1);
  65. SetPatch(1 , 416, 3, 1); SetPatch(10 , 421, 11, 1); SetPatch(2 , 469, 7, 2); SetPatch(0 , 476, 8, 1);
  66. SetPatch(2 , 485, 4, 2); SetPatch(0 , 489, 6, 1); SetPatch(2 , 495, 4, 2); SetPatch(0 , 499, 3, 1);
  67. SetPatch(12 , 509, 10, 1); SetPatch(2 , 528, 17, 4); SetPatch(13 , 536, 4, 2); SetPatch(0 , 540, 2, 1);
  68. SetPatch(0 , 545, 33, 1); SetPatch(12 , 578, 4, 1); SetPatch(6 , 582, 2, 1); SetPatch(6 , 585, 9, 1);
  69. SetPatch(0, MAX(LONGINT), -1, -1);
  70. END LoadPatches;
  71. PROCEDURE SeqProgram(): ADDRESS;
  72. CODE
  73. #IF I386 THEN
  74. CALL L1
  75. L1:
  76. POP EAX
  77. ADD EAX, L2 - L1
  78. POP EBP
  79. RET
  80. #ELSIF AMD64 THEN
  81. CALL L1
  82. L1:
  83. POP RAX
  84. ADD RAX, L2 - L1
  85. POP RBP
  86. RET
  87. #ELSE
  88. unimplemented
  89. #END
  90. L2:
  91. ; sequencer program, from Linux aic7xxx_seq.c
  92. DD 008066AFFH, 00804027FH, 000006A32H, 000006A12H
  93. DD 009D66AFFH, 009DC6AFFH, 059426500H, 0080201F7H
  94. DD 008C84EFFH, 008C060BFH, 068860B60H, 0680E0040H
  95. DD 0103E1F08H, 068860B60H, 0680E0040H, 0103E1F08H
  96. DD 0604A3EFFH, 07812FA40H, 008D4F6FFH, 0189C4E01H
  97. DD 000C06040H, 070124D00H, 0189C4E01H, 008C060BFH
  98. DD 05C926A00H, 018C84EFFH, 05BA86A02H, 0092052FFH
  99. DD 0006A6A0DH, 05C1E5200H, 03152B003H, 00952B0FFH
  100. DD 00954B1FFH, 00956B2FFH, 00950A3FFH, 009743EFFH
  101. DD 0087C90FFH, 009203EFFH, 058506500H, 0400E6500H
  102. DD 008CA1FF7H, 008C8A108H, 000CA6500H, 0083E65FFH
  103. DD 008C8A1F0H, 0081E0F0FH, 0001E0F00H, 008C8A1F0H
  104. DD 0080A050FH, 0000A0500H, 004006A5AH, 000026512H
  105. DD 000CA6A31H, 0686E3780H, 018CA65FFH, 008DC37FFH
  106. DD 008C86EFFH, 078766C00H, 000020120H, 028C8374CH
  107. DD 0787E1F08H, 0006E3708H, 000C86408H, 018CA6470H
  108. DD 0080A6CFFH, 018CA6420H, 00C086CFFH, 0690E0B40H
  109. DD 079000B80H, 000066AA4H, 000166A40H, 078FC0310H
  110. DD 008C850FFH, 000CC6A88H, 05C0E6A49H, 001266A01H
  111. DD 008CA6AFFH, 000020108H, 0789C0B02H, 0080201F7H
  112. DD 008CC06FFH, 0093266FFH, 018CA6501H, 078AA6680H
  113. DD 008A266FFH, 0689A0310H, 018C865FCH, 048B26500H
  114. DD 001326AFFH, 019186401H, 0091A6AFFH, 0091C6AFFH
  115. DD 000066A84H, 000020108H, 078BC0B02H, 008C806FFH
  116. DD 0093264FFH, 008CA6AFFH, 028C8645BH, 018C46200H
  117. DD 018CA65FCH, 008D46AFFH, 018CA65FAH, 008D46AFFH
  118. DD 018CA6504H, 018CA650BH, 008C865FFH, 019188C00H
  119. DD 078D80B02H, 060DE6501H, 0080201F7H, 0093206FFH
  120. DD 018CA65FFH, 068D865FFH, 00126930AH, 05C846500H
  121. DD 078F05140H, 000066AE4H, 000020108H, 05B406A04H
  122. DD 018A05001H, 0E0F65000H, 008A06AFFH, 0013A6AFFH
  123. DD 001226A02H, 068FC5140H, 008066AFFH, 0400E6500H
  124. DD 000166A20H, 0086E19F0H, 000186A08H, 000221108H
  125. DD 058666A08H, 000686A08H, 041226500H, 000006A12H
  126. DD 000166A40H, 009203EFFH, 0087CBAFFH, 0086EA1FFH
  127. DD 000186A08H, 000221108H, 058666A08H, 000686A80H
  128. DD 0006C3680H, 05BF26500H, 008C83DFFH, 0795864BFH
  129. DD 0720E6480H, 0723A64A0H, 0723264C0H, 0727A64E0H
  130. DD 001226A01H, 041226500H, 0082211F7H, 059426500H
  131. DD 008D406FFH, 0080201F7H, 0793C0C09H, 0680E0C08H
  132. DD 001226A01H, 009266AFFH, 030086A02H, 008086AFFH
  133. DD 0080201DFH, 0007A6A01H, 00C6C6AFFH, 03118A903H
  134. DD 03010A903H, 000CC6A08H, 05C086AA9H, 041786500H
  135. DD 0006A6AA8H, 0006A6A79H, 069603D40H, 0006A3504H
  136. DD 05B626500H, 001D46A80H, 0694E3610H, 0006C3610H
  137. DD 03110AC07H, 030108C03H, 03070A305H, 000CC6A88H
  138. DD 05C006AACH, 05BFA6500H, 000CC6A38H, 05C046AA3H
  139. DD 0698838FFH, 000040280H, 0086A35E7H, 031186903H
  140. DD 030106903H, 000106AFFH, 000126AFFH, 000146AFFH
  141. DD 0618C3801H, 0086A35BFH, 008CA69FFH, 0092635FFH
  142. DD 069900B04H, 0699C0B04H, 079920C10H, 0699A0B04H
  143. DD 008CA6AFFH, 05B4A3500H, 069F00280H, 079E065FFH
  144. DD 0187038FFH, 079E038FFH, 061BCEA80H, 018C838EFH
  145. DD 000C86A80H, 049AE6500H, 028C83833H, 009D064FFH
  146. DD 031C03904H, 001D66A09H, 079B4EB80H, 009D6EBF7H
  147. DD 069B8EB08H, 001D66A01H, 03110E908H, 030108C03H
  148. DD 000CC6A88H, 05C066A39H, 001186A08H, 0091A6AFFH
  149. DD 0091C6AFFH, 00126930DH, 05C846500H, 05C746A88H
  150. DD 05BFA6500H, 008C86AFFH, 018723908H, 020743A00H
  151. DD 079D80C01H, 079780C10H, 0092635FFH, 069DE0B04H
  152. DD 059F86500H, 031520803H, 0095038FFH, 0095208FFH
  153. DD 0095409FFH, 009560AFFH, 0095038FFH, 041226500H
  154. DD 059F86500H, 00804027FH, 001226AE1H, 041226500H
  155. DD 06A029304H, 0092693DFH, 069FC9320H, 001269302H
  156. DD 079FE9401H, 0092693D7H, 06A049308H, 031520803H
  157. DD 0095038FFH, 000020112H, 00CD46AFFH, 05B626500H
  158. DD 03110B405H, 0311A6A02H, 030108C03H, 000CC6A88H
  159. DD 05C046AB4H, 0091A6AFFH, 0091C6AFFH, 05BFA6500H
  160. DD 05B4A6A3DH, 001266AACH, 06A240B04H, 06A2A0B01H
  161. DD 07A260C10H, 0092693D7H, 06A2C9308H, 000020112H
  162. DD 041226500H, 05B626500H, 0094406FFH, 041226500H
  163. DD 000063D10H, 008CA34FFH, 0625E6580H, 008CAA10FH
  164. DD 008CAA107H, 008C8A040H, 000CA6500H, 000CA6580H
  165. DD 07A4EA080H, 0080C65FFH, 042606500H, 07A66A020H
  166. DD 0080C65FFH, 05BF26500H, 0626E3DA0H, 0080CA023H
  167. DD 05BF26500H, 0626E3DA0H, 04266B900H, 0626665FFH
  168. DD 001226AA1H, 008D46AFFH, 0726E5110H, 000186A40H
  169. DD 0080C65FFH, 05BF26500H, 072383DA0H, 000186A40H
  170. DD 008A634FFH, 062763480H, 00940A07FH, 000686A08H
  171. DD 041226500H, 05B3A6A64H, 06AEA6480H, 072CC6404H
  172. DD 072D26402H, 072946A00H, 072E66403H, 072C86401H
  173. DD 073286407H, 072906408H, 001226A11H, 05B2C6A07H
  174. DD 008D406FFH, 041226500H, 06A98A8FFH, 07AB0A2FFH
  175. DD 0006A6A01H, 05C1EB900H, 07AB0A2FFH, 001226A71H
  176. DD 008D46AFFH, 062B05140H, 0006A6A0DH, 05C1EB900H
  177. DD 009743EFFH, 0087C90FFH, 058506500H, 041346500H
  178. DD 06AB8A020H, 008C837FFH, 05BC86A00H, 05BDE6AFFH
  179. DD 008C8F8FFH, 008C84FFFH, 05BC86A01H, 05BDEB900H
  180. DD 0189E4F01H, 001226A02H, 05C8C6500H, 041346500H
  181. DD 001226A41H, 041226500H, 00140A004H, 05CA46500H
  182. DD 041346500H, 07A903610H, 031463805H, 031581404H
  183. DD 03160A903H, 000CC6AA3H, 05C046A38H, 000CC6AACH
  184. DD 05C066A14H, 05C086AA9H, 042906500H, 0086C36EFH
  185. DD 042906500H, 008C8640FH, 008C86407H, 0006E3700H
  186. DD 000A46AFFH, 05B986500H, 072FC51FFH, 07B063620H
  187. DD 05B869000H, 043086500H, 008D406FFH, 05BF26500H
  188. DD 063223DE0H, 063221220H, 05B306A51H, 05B806500H
  189. DD 008C837FFH, 0631AA100H, 07B1AA004H, 00940A0FBH
  190. DD 0006C3680H, 07A90A080H, 00940A07FH, 05B2C6AFFH
  191. DD 042906500H, 07B20A004H, 05CA46500H, 043226500H
  192. DD 05C8C6500H, 001226A31H, 05B2C6A0CH, 042906500H
  193. DD 001226A61H, 042906500H, 000063D10H, 00C6865FFH
  194. DD 008D406FFH, 07B320C01H, 06B320C04H, 0087A03E0H
  195. DD 063463DE0H, 008CC65FFH, 00CDA12FFH, 00CD406FFH
  196. DD 0080C65FFH, 07B420B02H, 00CD46AFFH, 001226AD1H
  197. DD 041226500H, 0092665FFH, 06B5A0B01H, 07B4C0C10H
  198. DD 06B540B04H, 008CA6AFFH, 06B589304H, 07B569401H
  199. DD 06B589410H, 0092693C7H, 008D499FFH, 06B5C9338H
  200. DD 00CD46AFFH, 06B603680H, 005226A21H, 0092065FFH
  201. DD 0636E51FFH, 008C837FFH, 0437A6AA1H, 008C851FFH
  202. DD 0437A6AB9H, 008A490FFH, 0737EBAFFH, 00920BAFFH
  203. DD 018CA65FFH, 063726C00H, 00CCA90FFH, 004CA6AFFH
  204. DD 07B923620H, 05B669000H, 0739265FFH, 0739052FFH
  205. DD 008CCBAFFH, 0092052FFH, 0097466FFH, 00D2065FFH
  206. DD 00C7EBAFFH, 05C926A00H, 0006A6A0DH, 0441E5100H
  207. DD 073EC3FFFH, 000A26AFFH, 05B663F00H, 073EC65FFH
  208. DD 0006C3620H, 06BA6A020H, 00CA2B9FFH, 004A26AFFH
  209. DD 008A465FFH, 000CC6AE0H, 05C126A45H, 001D06A01H
  210. DD 001D66A09H, 07BB2EB80H, 001D66A01H, 034A4E901H
  211. DD 000CC6A88H, 05C126A45H, 001186A01H, 0091A6AFFH
  212. DD 0091C6AFFH, 001266A0DH, 05C846500H, 00CA499FFH
  213. DD 008A465FFH, 000CC6AE0H, 05C126A45H, 001D06A01H
  214. DD 005DC6A01H, 000CC6A88H, 05C126A45H, 001186A01H
  215. DD 0091A6AFFH, 0091C6AFFH, 005266A01H, 031D86501H
  216. DD 001DCEE09H, 07BE2EE80H, 00DDC6AFFH, 0093265FFH
  217. DD 00126930AH, 044846500H, 008C837FFH, 05BA86A00H
  218. DD 00CA252FFH, 07BF20C01H, 06BF20C04H, 0080603E0H
  219. DD 00C7A03E0H, 008108CFFH, 008128DFFH, 00C148EFFH
  220. DD 008DA6CFFH, 008DA6CFFH, 008DA6CFFH, 008DA6CFFH
  221. DD 008DA6CFFH, 008DA6CFFH, 00CDA6CFFH, 028A4643DH
  222. DD 028C86455H, 018DA6C00H, 008C852FFH, 020DA6C00H
  223. DD 008C86AFFH, 020DA6C00H, 024DA6C00H, 008C865FFH
  224. DD 000CC6AE0H, 05C0E6A41H, 009E290FFH, 001D06A20H
  225. DD 07C303504H, 001DC6A1DH, 0642CEEDCH, 0443C6500H
  226. DD 001DC6A01H, 031D8A020H, 001DCEE09H, 07C36EE80H
  227. DD 001DC6A19H, 0643AEED8H, 009DC6AFFH, 06C3EEE18H
  228. DD 00CD46AFFH, 000CC6A88H, 05C0E6A41H, 001186A20H
  229. DD 0091A6AFFH, 0091C6AFFH, 0092635FFH, 06C683504H
  230. DD 000CA6AA0H, 018C86520H, 009326CFFH, 009326CFFH
  231. DD 009326CFFH, 009326CFFH, 009326CFFH, 009326CFFH
  232. DD 009326CFFH, 009326CFFH, 064546500H, 00126930AH
  233. DD 05C846500H, 07B603504H, 05C746AA0H, 05C766500H
  234. DD 05C766500H, 044766500H, 008CC65FFH, 008DA99FFH
  235. DD 008DA99FFH, 008DA99FFH, 008DA99FFH, 008DA99FFH
  236. DD 008DA99FFH, 00CDA99FFH, 07C849408H, 0092693F7H
  237. DD 06C889308H, 00CD46AFFH, 0097440FFH, 0088090FFH
  238. DD 005726AFFH, 064A040FFH, 064983FFFH, 004CA6AFFH
  239. DD 009203FFFH, 0006A6A01H, 05C1EB900H, 00C7EBAFFH
  240. DD 0092040FFH, 00C80BAFFH, 009743FFFH, 00C7E90FFH
  241. DD 0H
  242. END SeqProgram;
  243. PROCEDURE GetNext*(VAR line: SET): BOOLEAN;
  244. VAR opcode, c: LONGINT; parity: BOOLEAN;
  245. BEGIN
  246. (*
  247. WHILE Patches[patch].begin < pc DO INC(patch) END;
  248. WHILE (Patches[patch].begin = pc) & ~F[Patches[patch].f] DO (*patch disabled, skip*)
  249. INC(pc, Patches[patch].skipinstr); INC(patch, Patches[patch].skippatch)
  250. END;
  251. (*IF Patches[patch].begin = pc THEN INC(patch) END;*)
  252. *)
  253. WHILE (Patches[patch].begin = pc) DO
  254. IF F[Patches[patch].f] THEN
  255. INC(patch)
  256. ELSE
  257. INC(pc, Patches[patch].skipinstr); INC(patch, Patches[patch].skippatch)
  258. END
  259. END;
  260. SYSTEM.GET(Base+pc*4, line);
  261. IF line # {} THEN
  262. opcode := SYSTEM.VAL(LONGINT, LSH(line*{27..30}, -27));
  263. IF (8<=opcode) & (opcode<=0FH) THEN (*patch jump addr*)
  264. CorrectAddr(line)
  265. END;
  266. IF (opcode # 5) & (31 IN line) THEN (*all but ROL, patch immediate*)
  267. line := line- {0..7, 31}; (*use dconst*)
  268. END;
  269. IF F[8](*Ultra2*) THEN
  270. parity := TRUE;
  271. FOR c := 0 TO 30 DO
  272. IF c IN line THEN parity := ~parity END
  273. END;
  274. IF parity THEN INCL(line, 31) END
  275. ELSIF (8<=opcode) & (opcode<=0FH) THEN (*format3*)
  276. line := line*{0..16} + LSH(line*{17..26}, -17+16) + LSH(line*{27..30}, -27+25);
  277. ELSE (*format1*)
  278. line := line*{0..16} + LSH(line*{17..25}, -17+16) + LSH(line*{26}, -26+24) +
  279. LSH(line*{27..30}, -27+25)
  280. END;
  281. INC(pc)
  282. END;
  283. RETURN line # {}
  284. END GetNext;
  285. PROCEDURE Init*(Ultra2, Ultra, Wide, Twin, PageSCB, QueueRegs, CmdChan, TargetMode, Aic7895: BOOLEAN);
  286. BEGIN
  287. pc := 0; patch := 0;
  288. F[13] := Aic7895;
  289. F[12] := ~CmdChan;
  290. F[11] := Wide;
  291. F[10] := ~Ultra2;
  292. F[9] := Ultra;
  293. F[8] := Ultra2;
  294. F[7] := ~PageSCB;
  295. F[6] := PageSCB;
  296. F[5] := QueueRegs;
  297. F[4] := Twin;
  298. F[3] := ~QueueRegs;
  299. F[2] := CmdChan;
  300. F[1] := TargetMode;
  301. F[0] := FALSE;
  302. (* old version
  303. F[0] := FALSE; (*defined like that!*)
  304. F[1] := FALSE; (*target mode = TRUE, never used*)
  305. F[2] := CmdChan;
  306. F[3] := ~QueueRegs;
  307. F[4] := Twin;
  308. F[5] := QueueRegs;
  309. F[6] := PageSCB;
  310. F[7] := ~PageSCB;
  311. F[8] := Ultra2;
  312. F[9] := Ultra;
  313. F[10] := ~Ultra2;
  314. F[11] := Wide;
  315. F[12] := FALSE; (*defined like that!*)
  316. *)
  317. END Init;
  318. (*
  319. PROCEDURE Test*;
  320. VAR i: LONGINT; line: SET;
  321. BEGIN
  322. (*test for AIC7890*)
  323. Init(TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE);
  324. i := 0; WHILE GetNext(line) DO INC(i) END;
  325. Kernel.WriteString("Test - AIC7890 -> "); Kernel.WriteInt(i, 4); Kernel.WriteLn;
  326. (*test for AHA2940A *)
  327. Init(FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE);
  328. i := 0; WHILE GetNext(line) DO INC(i) END;
  329. Kernel.WriteString("Test - AHA2940A -> "); Kernel.WriteInt(i, 4); Kernel.WriteLn;
  330. END Test;
  331. *)
  332. BEGIN Base := SeqProgram(); LoadPatches;
  333. END Adaptec7Script.Test
  334. Converting Linux aic7xxx_seq.c:
  335. 1) generate sequencer code
  336. cp aic7xxx_seq.c seqprog
  337. chmod a+w seqprog
  338. vi seqprog
  339. :1
  340. /{
  341. :1,.d
  342. /}
  343. :.,$d
  344. :%s/[ ]*0x\(..\), 0x\(..\), 0x\(..\), 0x\(..\),/\U0\4\3\2\1H/
  345. :g/^/j
  346. :g/^/j
  347. :%s/ /, /g
  348. :%s/^/ DD /
  349. :wq
  350. 2) generate patch code
  351. cp aic7xxx_seq.c seqpatches
  352. chmod a+w seqpatches
  353. vi seqpatches
  354. :1
  355. /sequencer_patches
  356. :1,.d
  357. :%s/.*patch\([0-9][0-9]*\)_func\(.*\) }.*/SetPatch(\1 \2);/
  358. !!! stop here: how many substitutions? -> number of patches !!!
  359. :g/^/j
  360. :g/^/j
  361. :%s/^/ /
  362. :.,$d
  363. :wq
  364. 3) check the patches functions
  365. less aic7xxx_seq.c
  366. /aic7xxx_patch