x86.inc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {
  2. This file is part of the Free Pascal run time library.
  3. (c) 2000-2003 by Marco van de Voort
  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. implementation for FreeBSD/i386 specific functions
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY;without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. }
  12. {$packrecords C}
  13. TYPE uint=CARDINAL;
  14. CONST
  15. I386_GET_LDT =0;
  16. I386_SET_LDT =1;
  17. { I386_IOPL }
  18. I386_GET_IOPERM =3;
  19. I386_SET_IOPERM =4;
  20. { xxxxx }
  21. I386_VM86 =6;
  22. {
  23. type i386_ldt_args = record
  24. int start : longint;
  25. union descriptor *descs;
  26. int num;
  27. end;
  28. }
  29. type
  30. i386_ioperm_args = record
  31. start : uint;
  32. length : uint;
  33. enable : longint;
  34. end;
  35. i386_vm86_args = record
  36. sub_op : longint; { sub-operation to perform }
  37. sub_args : PAnsiChar; { args }
  38. end;
  39. sysarch_args = record
  40. op : longint;
  41. parms : PAnsiChar;
  42. end;
  43. {
  44. int i386_get_ldt __P((int, union descriptor *, int));
  45. int i386_set_ldt __P((int, union descriptor *, int));
  46. int i386_get_ioperm __P((unsigned int, unsigned int *, int *));
  47. int i386_set_ioperm __P((unsigned int, unsigned int, int));
  48. int i386_vm86 __P((int, void *));
  49. int i386_set_watch __P((int watchnum, unsigned int watchaddr, int size,
  50. int access, struct dbreg * d));
  51. int i386_clr_watch __P((int watchnum, struct dbreg * d));
  52. }
  53. Function IOPerm(From,Num:CARDINAL;Value:Longint):cint;
  54. var sg : i386_ioperm_args;
  55. sa : sysarch_args;
  56. begin
  57. sg.start:=From;
  58. sg.length:=Num;
  59. sg.enable:=value;
  60. sa.op:=i386_SET_IOPERM;
  61. sa.parms:=@sg;
  62. IOPerm:=do_syscall(syscall_nr_sysarch,longint(@sa));
  63. end;