i_linux.pas 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Peter Vreman
  4. This unit implements support information structures for linux
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  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. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. { This unit implements support information structures for linux. }
  19. unit i_linux;
  20. interface
  21. uses
  22. systems;
  23. const
  24. system_i386_linux_info : tsysteminfo =
  25. (
  26. system : system_i386_LINUX;
  27. name : 'Linux for i386';
  28. shortname : 'Linux';
  29. flags : [];
  30. cpu : cpu_i386;
  31. unit_env : 'LINUXUNITS';
  32. extradefines : 'UNIX';
  33. sourceext : '.pp';
  34. pasext : '.pas';
  35. exeext : '';
  36. defext : '.def';
  37. scriptext : '.sh';
  38. smartext : '.sl';
  39. unitext : '.ppu';
  40. unitlibext : '.ppl';
  41. asmext : '.s';
  42. objext : '.o';
  43. resext : '.res';
  44. resobjext : '.or';
  45. sharedlibext : '.so';
  46. staticlibext : '.a';
  47. staticlibprefix : 'libp';
  48. sharedlibprefix : 'lib';
  49. sharedClibext : '.so';
  50. staticClibext : '.a';
  51. staticClibprefix : 'lib';
  52. sharedClibprefix : 'lib';
  53. Cprefix : '';
  54. newline : #10;
  55. dirsep : '/';
  56. files_case_relevent : true;
  57. assem : as_i386_elf32;
  58. assemextern : as_gas;
  59. link : nil;
  60. linkextern : nil;
  61. ar : ar_gnu_ar;
  62. res : res_none;
  63. script : script_unix;
  64. endian : endian_little;
  65. alignment :
  66. (
  67. procalign : 4;
  68. loopalign : 4;
  69. jumpalign : 0;
  70. constalignmin : 0;
  71. constalignmax : 4;
  72. varalignmin : 0;
  73. varalignmax : 4;
  74. localalignmin : 0;
  75. localalignmax : 4;
  76. paraalign : 4;
  77. recordalignmin : 0;
  78. recordalignmax : 2;
  79. maxCrecordalign : 4
  80. );
  81. first_parm_offset : 8;
  82. heapsize : 256*1024;
  83. stacksize : 262144;
  84. DllScanSupported:false;
  85. use_function_relative_addresses : true
  86. );
  87. system_m68k_linux_info : tsysteminfo =
  88. (
  89. system : system_m68k_linux;
  90. name : 'Linux for m68k';
  91. shortname : 'linux';
  92. flags : [];
  93. cpu : cpu_m68k;
  94. unit_env : 'LINUXUNITS';
  95. extradefines : 'UNIX';
  96. sourceext : '.pp';
  97. pasext : '.pas';
  98. exeext : '';
  99. defext : '';
  100. scriptext : '.sh';
  101. smartext : '.sl';
  102. unitext : '.ppu';
  103. unitlibext : '.ppl';
  104. asmext : '.s';
  105. objext : '.o';
  106. resext : '.res';
  107. resobjext : '.or';
  108. sharedlibext : '.so';
  109. staticlibext : '.a';
  110. staticlibprefix : 'libp';
  111. sharedlibprefix : 'lib';
  112. sharedClibext : '.so';
  113. staticClibext : '.a';
  114. staticClibprefix : 'lib';
  115. sharedClibprefix : 'lib';
  116. Cprefix : '';
  117. newline : #10;
  118. dirsep : '/';
  119. files_case_relevent : true;
  120. assem : as_gas;
  121. assemextern : as_gas;
  122. link : nil;
  123. linkextern : nil;
  124. ar : ar_gnu_ar;
  125. res : res_none;
  126. script : script_unix;
  127. endian : endian_big;
  128. alignment :
  129. (
  130. procalign : 4;
  131. loopalign : 4;
  132. jumpalign : 0;
  133. constalignmin : 0;
  134. constalignmax : 4;
  135. varalignmin : 0;
  136. varalignmax : 4;
  137. localalignmin : 0;
  138. localalignmax : 4;
  139. paraalign : 4;
  140. recordalignmin : 0;
  141. recordalignmax : 2;
  142. maxCrecordalign : 4
  143. );
  144. first_parm_offset : 8;
  145. heapsize : 128*1024;
  146. stacksize : 32*1024*1024;
  147. DllScanSupported:false;
  148. use_function_relative_addresses : true
  149. );
  150. system_powerpc_linux_info : tsysteminfo =
  151. (
  152. system : system_powerpc_LINUX;
  153. name : 'Linux for PowerPC';
  154. shortname : 'linux';
  155. flags : [];
  156. cpu : cpu_powerpc;
  157. unit_env : '';
  158. extradefines : 'UNIX';
  159. sourceext : '.pp';
  160. pasext : '.pas';
  161. exeext : '';
  162. defext : '.def';
  163. scriptext : '.sh';
  164. smartext : '.sl';
  165. unitext : '.ppu';
  166. unitlibext : '.ppl';
  167. asmext : '.s';
  168. objext : '.o';
  169. resext : '.res';
  170. resobjext : '.or';
  171. sharedlibext : '.so';
  172. staticlibext : '.s';
  173. staticlibprefix : 'libp';
  174. sharedlibprefix : 'lib';
  175. sharedClibext : '.so';
  176. staticClibext : '.a';
  177. staticClibprefix : 'lib';
  178. sharedClibprefix : 'lib';
  179. Cprefix : '';
  180. newline : #10;
  181. dirsep : '/';
  182. files_case_relevent : true;
  183. assem : as_gas;
  184. assemextern : as_gas;
  185. link : nil;
  186. linkextern : nil;
  187. ar : ar_gnu_ar;
  188. res : res_none;
  189. script : script_unix;
  190. endian : endian_big;
  191. alignment :
  192. (
  193. procalign : 4;
  194. loopalign : 4;
  195. jumpalign : 0;
  196. constalignmin : 0;
  197. constalignmax : 4;
  198. varalignmin : 0;
  199. varalignmax : 4;
  200. localalignmin : 0;
  201. localalignmax : 4;
  202. paraalign : 4;
  203. recordalignmin : 0;
  204. recordalignmax : 2;
  205. maxCrecordalign : 4
  206. );
  207. first_parm_offset : 8;
  208. heapsize : 256*1024;
  209. stacksize : 32*1024*1024;
  210. DllScanSupported:false;
  211. use_function_relative_addresses : true
  212. );
  213. system_alpha_linux_info : tsysteminfo =
  214. (
  215. system : system_alpha_LINUX;
  216. name : 'Linux for Alpha';
  217. shortname : 'linux';
  218. flags : [];
  219. cpu : cpu_alpha;
  220. unit_env : 'LINUXUNITS';
  221. extradefines : 'UNIX';
  222. sourceext : '.pp';
  223. pasext : '.pas';
  224. exeext : '';
  225. defext : '.def';
  226. scriptext : '.sh';
  227. smartext : '.sl';
  228. unitext : '.ppu';
  229. unitlibext : '.ppl';
  230. asmext : '.s';
  231. objext : '.o';
  232. resext : '.res';
  233. resobjext : '.or';
  234. sharedlibext : '.so';
  235. staticlibext : '.a';
  236. staticlibprefix : 'libp';
  237. sharedlibprefix : 'lib';
  238. sharedClibext : '.so';
  239. staticClibext : '.a';
  240. staticClibprefix : 'lib';
  241. sharedClibprefix : 'lib';
  242. Cprefix : '';
  243. newline : #10;
  244. dirsep : '/';
  245. files_case_relevent : true;
  246. assem : as_gas;
  247. assemextern : as_gas;
  248. link : nil;
  249. linkextern : nil;
  250. ar : ar_gnu_ar;
  251. res : res_none;
  252. script : script_unix;
  253. endian : endian_little;
  254. alignment :
  255. (
  256. procalign : 4;
  257. loopalign : 4;
  258. jumpalign : 0;
  259. constalignmin : 0;
  260. constalignmax : 4;
  261. varalignmin : 0;
  262. varalignmax : 4;
  263. localalignmin : 0;
  264. localalignmax : 4;
  265. paraalign : 4;
  266. recordalignmin : 0;
  267. recordalignmax : 2;
  268. maxCrecordalign : 4
  269. );
  270. first_parm_offset : 8;
  271. heapsize : 256*1024;
  272. stacksize : 32*1024*1024;
  273. DllScanSupported:false;
  274. use_function_relative_addresses : true
  275. );
  276. system_x86_64_linux_info : tsysteminfo =
  277. (
  278. system : system_i386_LINUX;
  279. name : 'Linux for x86-64';
  280. shortname : 'linux';
  281. flags : [];
  282. cpu : cpu_x86_64;
  283. unit_env : 'LINUXUNITS';
  284. extradefines : 'UNIX';
  285. sourceext : '.pp';
  286. pasext : '.pas';
  287. exeext : '';
  288. defext : '.def';
  289. scriptext : '.sh';
  290. smartext : '.sl';
  291. unitext : '.ppu';
  292. unitlibext : '.ppl';
  293. asmext : '.s';
  294. objext : '.o';
  295. resext : '.res';
  296. resobjext : '.or';
  297. sharedlibext : '.so';
  298. staticlibext : '.a';
  299. staticlibprefix : 'libp';
  300. sharedlibprefix : 'lib';
  301. sharedClibext : '.so';
  302. staticClibext : '.a';
  303. staticClibprefix : 'lib';
  304. sharedClibprefix : 'lib';
  305. Cprefix : '';
  306. newline : #10;
  307. dirsep : '/';
  308. files_case_relevent : true;
  309. assem : as_i386_elf32;
  310. assemextern : as_gas;
  311. link : nil;
  312. linkextern : nil;
  313. ar : ar_gnu_ar;
  314. res : res_none;
  315. script : script_unix;
  316. endian : endian_little;
  317. alignment :
  318. (
  319. procalign : 4;
  320. loopalign : 4;
  321. jumpalign : 0;
  322. constalignmin : 0;
  323. constalignmax : 1;
  324. varalignmin : 0;
  325. varalignmax : 1;
  326. localalignmin : 0;
  327. localalignmax : 1;
  328. paraalign : 4;
  329. recordalignmin : 0;
  330. recordalignmax : 2;
  331. maxCrecordalign : 4
  332. );
  333. first_parm_offset : 16;
  334. heapsize : 256*1024;
  335. stacksize : 16*1024;
  336. DllScanSupported:false;
  337. use_function_relative_addresses : true
  338. );
  339. system_SPARC_linux_info : tsysteminfo =
  340. (
  341. system : system_SPARC_Linux;
  342. name : 'Linux for SPARC';
  343. shortname : 'linux';
  344. flags : [];
  345. cpu : cpu_SPARC;
  346. unit_env : 'LINUXUNITS';
  347. extradefines : 'UNIX';
  348. sourceext : '.pp';
  349. pasext : '.pas';
  350. exeext : '';
  351. defext : '.def';
  352. scriptext : '.sh';
  353. smartext : '.sl';
  354. unitext : '.ppu';
  355. unitlibext : '.ppl';
  356. asmext : '.s';
  357. objext : '.o';
  358. resext : '.res';
  359. resobjext : '.or';
  360. sharedlibext : '.so';
  361. staticlibext : '.a';
  362. staticlibprefix : 'libp';
  363. sharedlibprefix : 'lib';
  364. sharedClibext : '.so';
  365. staticClibext : '.a';
  366. staticClibprefix : 'lib';
  367. sharedClibprefix : 'lib';
  368. Cprefix : '';
  369. newline : #10;
  370. dirsep : '/';
  371. files_case_relevent : true;
  372. assem : as_gas;
  373. assemextern : as_gas;
  374. link : nil;
  375. linkextern : nil;
  376. ar : ar_gnu_ar;
  377. res : res_none;
  378. script : script_unix;
  379. endian : endian_little;
  380. alignment :
  381. (
  382. procalign : 4;
  383. loopalign : 4;
  384. jumpalign : 0;
  385. constalignmin : 0;
  386. constalignmax : 4;
  387. varalignmin : 0;
  388. varalignmax : 4;
  389. localalignmin : 0;
  390. localalignmax : 4;
  391. paraalign : 4;
  392. recordalignmin : 0;
  393. recordalignmax : 2;
  394. maxCrecordalign : 4
  395. );
  396. first_parm_offset : 8;
  397. heapsize : 256*1024;
  398. stacksize : 262144;
  399. DllScanSupported:false;
  400. use_function_relative_addresses : true
  401. );
  402. implementation
  403. initialization
  404. {$ifdef CPU86}
  405. {$ifdef linux}
  406. { some FreeBSD versions define linux as well }
  407. {$ifndef FreeBSD}
  408. set_source_info(system_i386_linux_info);
  409. {$endif FreeBSD}
  410. {$endif}
  411. {$endif CPU86}
  412. {$ifdef CPU68}
  413. {$ifdef linux}
  414. set_source_info(system_m68k_linux_info);
  415. {$endif linux}
  416. {$endif CPU68}
  417. {$ifdef CPU86_64}
  418. {$ifdef linux}
  419. set_source_info(system_x86_64_linux_info);
  420. {$endif linux}
  421. {$endif CPU86_64}
  422. {$ifdef CPUALPHA}
  423. {$ifdef linux}
  424. set_source_info(system_sparc_linux_info);
  425. {$endif linux}
  426. {$endif CPUALPHA}
  427. {$ifdef CPUSPARC}
  428. {$ifdef linux}
  429. set_source_info(system_sparc_linux_info);
  430. {$endif linux}
  431. {$endif CPUSPARC}
  432. end.
  433. {
  434. $Log$
  435. Revision 1.3 2002-08-13 18:01:51 carl
  436. * rename swatoperands to swapoperands
  437. + m68k first compilable version (still needs a lot of testing):
  438. assembler generator, system information , inline
  439. assembler reader.
  440. Revision 1.2 2002/08/12 15:08:39 carl
  441. + stab register indexes for powerpc (moved from gdb to cpubase)
  442. + tprocessor enumeration moved to cpuinfo
  443. + linker in target_info is now a class
  444. * many many updates for m68k (will soon start to compile)
  445. - removed some ifdef or correct them for correct cpu
  446. Revision 1.1 2002/07/26 21:15:38 florian
  447. * rewrote the system handling
  448. }