cpupi.pas 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. tx86_64procinfo = class(tcgprocinfo)
  26. function calc_stackframe_size:longint;override;
  27. procedure allocate_push_parasize(size:longint);override;
  28. end;
  29. implementation
  30. uses
  31. globals,
  32. cutils,
  33. tgobj;
  34. procedure tx86_64procinfo.allocate_push_parasize(size:longint);
  35. begin
  36. if size>maxpushedparasize then
  37. maxpushedparasize:=size;
  38. end;
  39. function tx86_64procinfo.calc_stackframe_size:longint;
  40. begin
  41. maxpushedparasize:=align(maxpushedparasize,max(aktalignment.localalignmin,16));
  42. { RSP should be aligned on 16 bytes }
  43. result:=Align(tg.direction*tg.lasttemp,16)+maxpushedparasize;
  44. end;
  45. begin
  46. cprocinfo:=tx86_64procinfo;
  47. end.
  48. {
  49. $Log$
  50. Revision 1.5 2004-06-20 08:55:32 florian
  51. * logs truncated
  52. Revision 1.4 2004/06/16 20:07:11 florian
  53. * dwarf branch merged
  54. Revision 1.3.2.1 2004/04/23 22:12:37 florian
  55. * fixed some potential stack corruption reasons
  56. Revision 1.3 2004/02/04 22:01:13 peter
  57. * first try to get cpupara working for x86_64
  58. }