mtrr.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /****************************************************************************
  2. *
  3. * SciTech OS Portability Manager Library
  4. *
  5. * ========================================================================
  6. *
  7. * The contents of this file are subject to the SciTech MGL Public
  8. * License Version 1.0 (the "License"); you may not use this file
  9. * except in compliance with the License. You may obtain a copy of
  10. * the License at http://www.scitechsoft.com/mgl-license.txt
  11. *
  12. * Software distributed under the License is distributed on an
  13. * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  14. * implied. See the License for the specific language governing
  15. * rights and limitations under the License.
  16. *
  17. * The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
  18. *
  19. * The Initial Developer of the Original Code is SciTech Software, Inc.
  20. * All Rights Reserved.
  21. *
  22. * ========================================================================
  23. *
  24. * Language: ANSI C
  25. * Environment: Any
  26. *
  27. * Description: Include file defining the external ring 0 helper functions
  28. * needed by the MTRR module. These functions may be included
  29. * directly for native ring 0 device drivers, or they may
  30. * be calls down to a ring 0 helper device driver where
  31. * appropriate (or the entire MTRR module may be located in
  32. * the device driver if the device driver is 32-bit).
  33. *
  34. ****************************************************************************/
  35. #ifndef __MTRR_H
  36. #define __MTRR_H
  37. #include "scitech.h"
  38. /*--------------------------- Function Prototypes -------------------------*/
  39. #ifdef __cplusplus
  40. extern "C" { /* Use "C" linkage when in C++ mode */
  41. #endif
  42. /* Internal functions (requires ring 0 access or helper functions!) */
  43. void MTRR_init(void);
  44. int MTRR_enableWriteCombine(ulong base,ulong size,uint type);
  45. /* External assembler helper functions */
  46. ibool _ASMAPI _MTRR_isRing0(void);
  47. ulong _ASMAPI _MTRR_disableInt(void);
  48. void _ASMAPI _MTRR_restoreInt(ulong flags);
  49. ulong _ASMAPI _MTRR_saveCR4(void);
  50. void _ASMAPI _MTRR_restoreCR4(ulong cr4Val);
  51. uchar _ASMAPI _MTRR_getCx86(uchar reg);
  52. void _ASMAPI _MTRR_setCx86(uchar reg,uchar data);
  53. #ifdef __16BIT__
  54. void _ASMAPI _MTRR_readMSR(ulong reg, ulong far *eax, ulong far *edx);
  55. #else
  56. void _ASMAPI _MTRR_readMSR(ulong reg, ulong *eax, ulong *edx);
  57. #endif
  58. void _ASMAPI _MTRR_writeMSR(ulong reg, ulong eax, ulong edx);
  59. #ifdef __cplusplus
  60. } /* End of "C" linkage for C++ */
  61. #endif
  62. #endif /* __MTRR_H */