cpupi.pas 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. unit cpupi;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. cutils,
  23. procinfo,cpuinfo,
  24. psub;
  25. type
  26. TSparcProcInfo=class(tcgprocinfo)
  27. public
  28. constructor create(aparent:tprocinfo);override;
  29. procedure allocate_push_parasize(size:longint);override;
  30. function calc_stackframe_size:longint;override;
  31. end;
  32. implementation
  33. uses
  34. systems,globals,
  35. tgobj,paramgr,symconst;
  36. constructor tsparcprocinfo.create(aparent:tprocinfo);
  37. begin
  38. inherited create(aparent);
  39. maxpushedparasize:=0;
  40. end;
  41. procedure tsparcprocinfo.allocate_push_parasize(size:longint);
  42. begin
  43. if size>maxpushedparasize then
  44. maxpushedparasize:=size;
  45. end;
  46. function TSparcProcInfo.calc_stackframe_size:longint;
  47. begin
  48. {
  49. Stackframe layout:
  50. %fp
  51. <locals>
  52. <temp>
  53. <arguments 6-n for calling>
  54. %sp+92
  55. <space for arguments 0-5> \
  56. <return pointer for calling> | included in first_parm_offset
  57. <register window save area for calling> /
  58. %sp
  59. Alignment must be the max available, as doubles require
  60. 8 byte alignment
  61. }
  62. result:=Align(tg.direction*tg.lasttemp+maxpushedparasize+target_info.first_parm_offset,aktalignment.localalignmax);
  63. end;
  64. begin
  65. cprocinfo:=TSparcProcInfo;
  66. end.
  67. {
  68. $Log$
  69. Revision 1.28 2004-06-20 08:55:32 florian
  70. * logs truncated
  71. Revision 1.27 2004/06/16 20:07:10 florian
  72. * dwarf branch merged
  73. Revision 1.26.2.1 2004/05/31 22:08:21 peter
  74. * fix passing of >6 arguments
  75. Revision 1.26 2004/03/12 08:18:11 mazen
  76. - revert '../' from include path
  77. Revision 1.25 2004/03/11 16:22:09 mazen
  78. + help lazarus analyze the file
  79. Revision 1.24 2004/02/25 14:25:47 mazen
  80. * fix compile problem for sparc
  81. }