cpupi.pas 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {
  2. $Id$
  3. Copyright (c) 2002 by Florian Klaempfl
  4. This unit contains the CPU specific part of tprocinfo
  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 contains the CPU specific part of tprocinfo. }
  19. unit cpupi;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. psub,procinfo;
  24. type
  25. ti386procinfo = class(tcgprocinfo)
  26. constructor create(aparent:tprocinfo);override;
  27. function calc_stackframe_size:longint;override;
  28. end;
  29. implementation
  30. uses
  31. cutils,
  32. globals,
  33. tgobj,
  34. cpubase;
  35. constructor ti386procinfo.create(aparent:tprocinfo);
  36. begin
  37. inherited create(aparent);
  38. got:=NR_EBX;
  39. end;
  40. function ti386procinfo.calc_stackframe_size:longint;
  41. begin
  42. { align to 4 bytes at least
  43. otherwise all those subl $2,%esp are meaningless PM }
  44. result:=Align(tg.direction*tg.lasttemp,min(aktalignment.localalignmin,4));
  45. end;
  46. begin
  47. cprocinfo:=ti386procinfo;
  48. end.
  49. {
  50. $Log$
  51. Revision 1.16 2003-10-14 00:30:48 florian
  52. + some code for PIC support added
  53. Revision 1.15 2003/10/03 22:00:33 peter
  54. * parameter alignment fixes
  55. Revision 1.14 2003/10/01 20:34:49 peter
  56. * procinfo unit contains tprocinfo
  57. * cginfo renamed to cgbase
  58. * moved cgmessage to verbose
  59. * fixed ppc and sparc compiles
  60. Revision 1.13 2003/09/25 21:30:11 peter
  61. * parameter fixes
  62. Revision 1.12 2003/09/23 17:56:06 peter
  63. * locals and paras are allocated in the code generation
  64. * tvarsym.localloc contains the location of para/local when
  65. generating code for the current procedure
  66. Revision 1.11 2003/09/09 21:03:17 peter
  67. * basics for x86 register calling
  68. Revision 1.10 2003/09/03 15:55:01 peter
  69. * NEWRA branch merged
  70. Revision 1.9.2.1 2003/08/31 15:46:26 peter
  71. * more updates for tregister
  72. Revision 1.9 2003/07/06 17:58:22 peter
  73. * framepointer fixes for sparc
  74. * parent framepointer code more generic
  75. Revision 1.8 2003/06/13 21:19:31 peter
  76. * current_procdef removed, use current_procinfo.procdef instead
  77. Revision 1.7 2003/06/12 18:12:49 jonas
  78. * fixed compilation problems
  79. Revision 1.6 2003/06/12 16:43:07 peter
  80. * newra compiles for sparc
  81. Revision 1.5 2003/05/25 10:26:15 peter
  82. * fix interrupt stack allocation
  83. Revision 1.4 2003/05/22 21:32:29 peter
  84. * removed some unit dependencies
  85. Revision 1.3 2003/04/27 11:21:35 peter
  86. * aktprocdef renamed to current_procinfo.procdef
  87. * procinfo renamed to current_procinfo
  88. * procinfo will now be stored in current_module so it can be
  89. cleaned up properly
  90. * gen_main_procsym changed to create_main_proc and release_main_proc
  91. to also generate a tprocinfo structure
  92. * fixed unit implicit initfinal
  93. Revision 1.2 2003/04/27 07:48:05 peter
  94. * updated for removed lexlevel
  95. Revision 1.1 2002/08/17 09:23:44 florian
  96. * first part of procinfo rewrite
  97. }