1
0

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. // 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 usize 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. u32 pid;
  21. u32 what;
  22. } prof;
  23. u64 cyclefreq; /* cycle clock frequency if there is one, 0 otherwise */
  24. i64 kcycles; /* cycles spent in kernel */
  25. i64 pcycles; /* cycles spent in process (kernel + user) */
  26. u32 nixpid; /* might as well put the pid here */
  27. u32 clock;
  28. /* scratch space for kernel use (e.g., mips fp delay-slot execution) */
  29. u32 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;