ocm_proc.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* $Header$ */
  2. /* process.h - Define administration types and functions
  3. *
  4. * This file is to be included by implementors of the higher
  5. * level routines
  6. *
  7. */
  8. #include "parco.h"
  9. #ifndef ptrdiff /* This type must be able to hold a pointer difference */
  10. #define ptrdiff int /* Define as long int if necessary */
  11. #endif
  12. #define nil 0
  13. void *alloc(), free();
  14. typedef ptrdiff wordsize, identification;
  15. wordsize top_size();
  16. int top_save();
  17. void top_load(); /* Primitives */
  18. struct procgroup;
  19. struct process {
  20. struct process *next; /* Next process in the same group */
  21. struct procgroup *down; /* Process group running under this process */
  22. void *stack; /* Pointer to the saved stack top */
  23. identification id; /* Coroutine identification */
  24. };
  25. #define init_between __i_b__ /* These names are hidden */
  26. #define save_between __s_b__
  27. #define load_betweens __l_b__
  28. #define delete_between __d_b__
  29. void init_between(), save_between(), load_betweens(), delete_between();
  30. struct procgroup {
  31. struct process **active;/* Active process within this group */
  32. struct procgroup *up; /* The group that this group belongs to */
  33. struct process *first; /* List of processes belonging to this group */
  34. void *s_brk; /* Point where the stack is split */
  35. void *between; /* Stack space between s_brk and up->s_brk */
  36. };
  37. #define group __grp__ /* Ignore this please */
  38. #define highest_group __hgrp__
  39. extern struct procgroup *group; /* Current running group */
  40. extern struct procgroup *highest_group; /* highest group that has been seen
  41. * while searching for a process
  42. */