cpupi.pas 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.17 2004-06-20 08:55:31 florian
  52. * logs truncated
  53. }