tos.h 1.2 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. typedef struct Tos Tos;
  10. typedef struct Plink Plink;
  11. #pragma incomplete Plink
  12. struct Tos {
  13. struct /* Per process profiling */
  14. {
  15. Plink *pp; /* known to be 0(ptr) */
  16. Plink *next; /* known to be 4(ptr) */
  17. Plink *last;
  18. Plink *first;
  19. uint32_t pid;
  20. uint32_t what;
  21. } prof;
  22. uint64_t cyclefreq; /* cycle clock frequency if there is one, 0 otherwise */
  23. int64_t kcycles; /* cycles spent in kernel */
  24. int64_t pcycles; /* cycles spent in process (kernel + user) */
  25. uint32_t pid; /* might as well put the pid here */
  26. uint32_t clock;
  27. /* scratch space for kernel use (e.g., mips fp delay-slot execution) */
  28. uint32_t kscr[4];
  29. /*
  30. * Fields below are not available on Plan 9 kernels.
  31. */
  32. int nixtype; /* role of the core we are running at */
  33. int core; /* core we are running at */
  34. /* top of stack is here */
  35. };
  36. extern Tos *_tos;