cpupi.pas 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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;
  24. type
  25. ti386procinfo = class(tcgprocinfo)
  26. procedure allocate_interrupt_parameter;override;
  27. procedure allocate_framepointer;override;
  28. end;
  29. implementation
  30. uses
  31. cgbase, cpubase, rgobj;
  32. procedure ti386procinfo.allocate_interrupt_parameter;
  33. begin
  34. { we push Flags and CS as long
  35. to cope with the IRETD
  36. and we save 6 register + 4 selectors }
  37. inc(procdef.parast.address_fixup,8+6*4+4*2);
  38. end;
  39. procedure ti386procinfo.allocate_framepointer;
  40. begin
  41. if framepointer.number=NR_EBP then
  42. begin
  43. { Make sure the register allocator won't allocate registers
  44. into ebp }
  45. include(rg.usedintinproc,RS_EBP);
  46. exclude(rg.unusedregsint,RS_EBP);
  47. end;
  48. end;
  49. begin
  50. cprocinfo:=ti386procinfo;
  51. end.
  52. {
  53. $Log$
  54. Revision 1.7 2003-06-12 18:12:49 jonas
  55. * fixed compilation problems
  56. Revision 1.6 2003/06/12 16:43:07 peter
  57. * newra compiles for sparc
  58. Revision 1.5 2003/05/25 10:26:15 peter
  59. * fix interrupt stack allocation
  60. Revision 1.4 2003/05/22 21:32:29 peter
  61. * removed some unit dependencies
  62. Revision 1.3 2003/04/27 11:21:35 peter
  63. * aktprocdef renamed to current_procdef
  64. * procinfo renamed to current_procinfo
  65. * procinfo will now be stored in current_module so it can be
  66. cleaned up properly
  67. * gen_main_procsym changed to create_main_proc and release_main_proc
  68. to also generate a tprocinfo structure
  69. * fixed unit implicit initfinal
  70. Revision 1.2 2003/04/27 07:48:05 peter
  71. * updated for removed lexlevel
  72. Revision 1.1 2002/08/17 09:23:44 florian
  73. * first part of procinfo rewrite
  74. }