op_x86_model.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 models' perfctr support.
  27. */
  28. struct op_x86_model_spec {
  29. int (*init)(struct oprofile_operations *ops);
  30. void (*exit)(void);
  31. unsigned int num_counters;
  32. unsigned int num_controls;
  33. void (*fill_in_addresses)(struct op_msrs * const msrs);
  34. void (*setup_ctrs)(struct op_msrs const * const msrs);
  35. int (*check_ctrs)(struct pt_regs * const regs,
  36. struct op_msrs const * const msrs);
  37. void (*start)(struct op_msrs const * const msrs);
  38. void (*stop)(struct op_msrs const * const msrs);
  39. void (*shutdown)(struct op_msrs const * const msrs);
  40. };
  41. extern struct op_x86_model_spec op_ppro_spec;
  42. extern struct op_x86_model_spec const op_p4_spec;
  43. extern struct op_x86_model_spec const op_p4_ht2_spec;
  44. extern struct op_x86_model_spec const op_amd_spec;
  45. extern struct op_x86_model_spec op_arch_perfmon_spec;
  46. extern void arch_perfmon_setup_counters(void);
  47. #endif /* OP_X86_MODEL_H */