ports.inc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Michael Van Canneyt
  4. member of the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$IFDEF VER3_0}
  12. { Bootstrapping kludge. Note that these do nothing, but since I/O port access is
  13. not necessary for bootstrapping on any x86_64 target, these are only added to
  14. make the rtl compile with 3.0.
  15. }
  16. procedure fpc_x86_outportb(p:longint;v:byte); begin end;
  17. procedure fpc_x86_outportw(p:longint;v:word); begin end;
  18. procedure fpc_x86_outportl(p:longint;v:longint); begin end;
  19. function fpc_x86_inportb(p:word):byte; begin fpc_x86_inportb:=0; end;
  20. function fpc_x86_inportw(p:word):word; begin fpc_x86_inportw:=0; end;
  21. function fpc_x86_inportl(p:word):longint; begin fpc_x86_inportl:=0; end;
  22. {$ENDIF VER3_0}
  23. { to give easy port access like tp with port[] }
  24. procedure tport.writeport(p : Longint;data : byte);inline;
  25. begin
  26. fpc_x86_outportb(p,data)
  27. end;
  28. function tport.readport(p : Longint) : byte;inline;
  29. begin
  30. readport := fpc_x86_inportb(p);
  31. end;
  32. procedure tportw.writeport(p : longint;data : word);inline;
  33. begin
  34. fpc_x86_outportw(p,data)
  35. end;
  36. function tportw.readport(p : longint) : word;inline;
  37. begin
  38. readport := fpc_x86_inportw(p);
  39. end;
  40. procedure tportl.writeport(p : longint;data : longint);inline;
  41. begin
  42. fpc_x86_outportl(p,data)
  43. end;
  44. function tportl.readport(p : longint) : longint;inline;
  45. begin
  46. readPort := fpc_x86_inportl(p);
  47. end;