ocm_proc.h 1.8 KB

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