cpupi.pas 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.29 2005-02-14 17:13:10 peter
  70. * truncate log
  71. }