op_x86_model.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @file op_x86_model.h
  3. * interface to x86 model-specific MSR operations
  4. *
  5. * @remark Copyright 2002 OProfile authors
  6. * @remark Read the file COPYING
  7. *
  8. * @author Graydon Hoare
  9. */
  10. #ifndef OP_X86_MODEL_H
  11. #define OP_X86_MODEL_H
  12. struct op_saved_msr {
  13. unsigned int high;
  14. unsigned int low;
  15. };
  16. struct op_msr {
  17. unsigned long addr;
  18. struct op_saved_msr saved;
  19. };
  20. struct op_msrs {
  21. struct op_msr * counters;
  22. struct op_msr * controls;
  23. };
  24. struct pt_regs;
  25. /* The model vtable abstracts the differences between
  26. * various x86 CPU model's perfctr support.
  27. */
  28. struct op_x86_model_spec {
  29. unsigned int const num_counters;
  30. unsigned int const num_controls;
  31. void (*fill_in_addresses)(struct op_msrs * const msrs);
  32. void (*setup_ctrs)(struct op_msrs const * const msrs);
  33. int (*check_ctrs)(struct pt_regs * const regs,
  34. struct op_msrs const * const msrs);
  35. void (*start)(struct op_msrs const * const msrs);
  36. void (*stop)(struct op_msrs const * const msrs);
  37. };
  38. extern struct op_x86_model_spec const op_ppro_spec;
  39. extern struct op_x86_model_spec const op_p4_spec;
  40. extern struct op_x86_model_spec const op_p4_ht2_spec;
  41. extern struct op_x86_model_spec const op_athlon_spec;
  42. #endif /* OP_X86_MODEL_H */