i_uefi.pas 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. {
  2. Copyright (c) 2014 by Olivier Coursière
  3. This unit implements support information structures for uefi,
  4. Based on Sven Barth's i_nativent
  5. Based on Peter Vreman's i_win
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  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., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. { This unit implements support information structures for uefi. }
  20. unit i_uefi;
  21. {$i fpcdefs.inc}
  22. interface
  23. uses
  24. systems;
  25. const
  26. system_i386_uefi_info : tsysteminfo =
  27. (
  28. system : system_i386_uefi;
  29. name : 'UEFI for i386';
  30. shortname : 'uefi';
  31. flags : [tf_files_case_aware,tf_use_function_relative_addresses,tf_smartlink_library
  32. ,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},
  33. tf_no_generic_stackcheck{,tf_has_winlike_resources},tf_under_development//,
  34. {tf_dwarf_only_local_labels}{,tf_pic_uses_got}];
  35. cpu : cpu_i386;
  36. unit_env : 'UEFIUNITS';
  37. extradefines : 'UEFI,FPC_OS_UNICODE';
  38. exeext : '.efi';
  39. defext : '.def';
  40. scriptext : '.bat';
  41. smartext : '.sl';
  42. unitext : '.ppu';
  43. unitlibext : '.ppl';
  44. asmext : '.s';
  45. objext : '.o';
  46. resext : '.res';
  47. resobjext : '.or';
  48. sharedlibext : '.efi';
  49. staticlibext : '.a';
  50. staticlibprefix : 'libp';
  51. sharedlibprefix : '';
  52. sharedClibext : '.efi';
  53. staticClibext : '.a';
  54. staticClibprefix : 'lib';
  55. sharedClibprefix : '';
  56. importlibprefix : 'libimp';
  57. importlibext : '.a';
  58. Cprefix : '_';
  59. newline : #13#10;
  60. dirsep : '\';
  61. assem : as_i386_pecoff;
  62. assemextern : as_gas;
  63. link : ld_int_uefi;
  64. linkextern : ld_none;
  65. ar : ar_gnu_ar;
  66. res : res_gnu_windres;
  67. dbg : dbg_stabs;
  68. script : script_dos;
  69. endian : endian_little;
  70. alignment :
  71. (
  72. procalign : 16;
  73. loopalign : 4;
  74. jumpalign : 0;
  75. constalignmin : 0;
  76. constalignmax : 16;
  77. varalignmin : 0;
  78. varalignmax : 16;
  79. localalignmin : 4;
  80. localalignmax : 8;
  81. recordalignmin : 0;
  82. recordalignmax : 4;
  83. maxCrecordalign : 16
  84. );
  85. first_parm_offset : 8;
  86. stacksize : 16*1024*1024;
  87. stackalign : 16;
  88. abi : abi_default;
  89. { note: default LLVM stack alignment is 16 bytes for this target }
  90. { TODO : check this... Took from Haiku, but should probably come from Windows ? }
  91. llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S32';
  92. );
  93. system_x86_64_uefi_info : tsysteminfo =
  94. (
  95. system : system_x86_64_uefi;
  96. name : 'UEFI for x86_64';
  97. shortname : 'uefi';
  98. flags : [tf_files_case_aware,tf_use_function_relative_addresses,tf_smartlink_library
  99. ,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},{tf_dwarf_relative_addresses,}
  100. tf_no_generic_stackcheck{,tf_has_winlike_resources},tf_under_development,{tf_no_pic_supported,}
  101. tf_dwarf_only_local_labels{,tf_pic_uses_got}{,tf_pic_default,tf_library_needs_pic}];
  102. cpu : cpu_x86_64;
  103. unit_env : 'UEFIUNITS';
  104. extradefines : 'UEFI,FPC_OS_UNICODE';
  105. exeext : '.efi';
  106. defext : '.def';
  107. scriptext : '.bat';
  108. smartext : '.sl';
  109. unitext : '.ppu';
  110. unitlibext : '.ppl';
  111. asmext : '.s';
  112. objext : '.o';
  113. resext : '.res';
  114. resobjext : '.or';
  115. sharedlibext : '.efi';
  116. staticlibext : '.a';
  117. staticlibprefix : 'libp';
  118. sharedlibprefix : '';
  119. sharedClibext : '.efi';
  120. staticClibext : '.a';
  121. staticClibprefix : 'lib';
  122. sharedClibprefix : '';
  123. importlibprefix : 'libimp';
  124. importlibext : '.a';
  125. Cprefix : '_';
  126. newline : #13#10;
  127. dirsep : '\';
  128. assem : as_x86_64_pecoff;
  129. assemextern : as_gas;
  130. link : ld_int_uefi;
  131. linkextern : ld_none;
  132. ar : ar_gnu_ar;
  133. res : res_gnu_windres;
  134. dbg : dbg_stabs;
  135. script : script_dos;
  136. endian : endian_little;
  137. alignment :
  138. (
  139. procalign : 16;
  140. loopalign : 8;
  141. jumpalign : 4;
  142. constalignmin : 0;
  143. constalignmax : 16;
  144. varalignmin : 0;
  145. varalignmax : 16;
  146. localalignmin : 8;
  147. localalignmax : 16;
  148. recordalignmin : 0;
  149. recordalignmax : 8;
  150. maxCrecordalign : 16
  151. );
  152. first_parm_offset : 16;
  153. stacksize : 16*1024*1024;
  154. stackalign : 16;
  155. abi : abi_default;
  156. { note: default LLVM stack alignment is 16 bytes for this target }
  157. { TODO : check this... Took from Win64 }
  158. llvmdatalayout : 'e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128';
  159. );
  160. implementation
  161. initialization
  162. {$ifdef CPUI386}
  163. {$ifdef UEFI}
  164. set_source_info(system_i386_uefi_info);
  165. {$endif UEFI}
  166. {$endif CPUI386}
  167. {$ifdef CPUX86_64}
  168. {$ifdef UEFI}
  169. set_source_info(system_x86_64_uefi_info);
  170. {$endif UEFI}
  171. {$endif CPUX86_64}
  172. end.