ocm_proc.h 1.8 KB

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