PASPROC.LST 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. Listing:
  2. 1 (* Release 3.10 *)
  3. 2 (*-------------------------------------------------------------------------*
  4. 3 * *
  5. 4 * PASPROC.DEF - Modula-2 interface to PASPROC.ITF *
  6. 5 * *
  7. 6 * COPYRIGHT (C) 1989..1992 Clarion Software Corporation. *
  8. 7 * All Rights Reserved *
  9. 8 * *
  10. 9 *--------------------------------------------------------------------------*)
  11. 10
  12. 11 (*# project("#set tspas='on'") *)
  13. 12 (*# call(o_a_copy => on,
  14. 13 o_a_size => on,
  15. 14 near_call=>off) *)
  16. 15 (*# call(seg_name => PASPROC) *)
  17. 16 (*# module(implementation=>off) *)
  18. 17
  19. 18 DEFINITION MODULE PasProc;
  20. 19
  21. 20 CONST
  22. 21 MaxProcess = 32;
  23. 22 TYPE SIGNAL;
  24. 23
  25. 24
  26. 25 PROCEDURE StartScheduler;
  27. 26 (* start the time sliced scheduler *)
  28. 27
  29. 28 PROCEDURE StopScheduler;
  30. 29 (* stops the time sliced scheduler *)
  31. 30
  32. 31
  33. 32 PROCEDURE StartProcess(P: PROC; N: CARDINAL; Pr: CARDINAL);
  34. ***** ^ undeclared identifier
  35. 33 (* Start a new process *)
  36. 34
  37. 35 PROCEDURE StopProcess();
  38. 36 (* Stops current thread *)
  39. 37
  40. 38
  41. 39 PROCEDURE SEND(s: SIGNAL);
  42. 40 (* Send a signal *)
  43. 41
  44. 42 PROCEDURE WAIT(s: SIGNAL);
  45. 43 (* Wait for signal *)
  46. 44
  47. 45 PROCEDURE Notify(s: SIGNAL);
  48. 46 (*
  49. 47 Causes a task waiting on signal s to be scheduled when possible,
  50. 48 (e.g. at next time slice).
  51. 49 If no-one is waiting on s then the call has NO effect.
  52. 50 This call CANNOT cause reschedule, so may be used by an interrupt
  53. 51 handler to safely notify another process of an events occurance.
  54. 52 *)
  55. 53
  56. 54 PROCEDURE Awaited(s: SIGNAL) : BOOLEAN;
  57. 55 (* Returns if any process are waiting on signal *)
  58. 56
  59. 57 PROCEDURE Init(VAR s: SIGNAL);
  60. 58 (* Initialize a signal *)
  61. 59
  62. 60
  63. 61 (*# save, call(c_conv=>on) *)
  64. 62 PROCEDURE Delay(T: CARDINAL);
  65. 63 (* delays for at least T timeslices *)
  66. 64 (*# restore *)
  67. 65
  68. 66 (*# save, call(reg_saved=>(ax,bx,cx,dx,di,si,ds,es,st1,st2)) *)
  69. 67 PROCEDURE Lock;
  70. 68 (*
  71. 69 Critical region lock. Prevents the current process from
  72. 70 being de-scheduled by timeslicing, until a call to Unlock.
  73. 71 Calls to Lock may be nested.
  74. 72 *)
  75. 73
  76. 74 PROCEDURE Unlock;
  77. 75 (*# restore *)
  78. 76
  79. 77 (* Unlock procedure, always paired with a call to Lock. *)
  80. 78
  81. 79 PROCEDURE Idler;
  82. 80
  83. 81 END PasProc.
  84. ***** ^ not supported yet
  85. 2 errors