tos.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. // This TOS is compatible with Plan 9 TOS.
  10. typedef struct Tos Tos;
  11. // This type does not matter; we don't use it.
  12. typedef uintptr_t Plink;
  13. struct Tos {
  14. struct /* Per process profiling */
  15. {
  16. Plink *pp; /* known to be 0(ptr) */
  17. Plink *next; /* known to be 4(ptr) */
  18. Plink *last;
  19. Plink *first;
  20. uint32_t pid;
  21. uint32_t what;
  22. } prof;
  23. uint64_t cyclefreq; /* cycle clock frequency if there is one, 0 otherwise */
  24. int64_t kcycles; /* cycles spent in kernel */
  25. int64_t pcycles; /* cycles spent in process (kernel + user) */
  26. uint32_t nixpid; /* might as well put the pid here */
  27. uint32_t clock;
  28. /* scratch space for kernel use (e.g., mips fp delay-slot execution) */
  29. uint32_t kscr[4];
  30. /*
  31. * Fields below are not available on Plan 9 kernels.
  32. */
  33. int nixtype; /* role of the core we are running at */
  34. int core; /* core we are running at */
  35. /* top of stack is here */
  36. };
  37. extern Tos *_tos;