]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/MAI/bios_emulator/scitech/include/mtrr.h
* Patch by Thomas Frieden, 13 Nov 2002:
[karo-tx-uboot.git] / board / MAI / bios_emulator / scitech / include / mtrr.h
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
36 #ifndef __MTRR_H
37 #define __MTRR_H
38
39 #include "scitech.h"
40
41 /*--------------------------- Function Prototypes -------------------------*/
42
43 #ifdef  __cplusplus
44 extern "C" {            /* Use "C" linkage when in C++ mode */
45 #endif
46
47 /* Internal functions (requires ring 0 access or helper functions!) */
48
49 void    MTRR_init(void);
50 int     MTRR_enableWriteCombine(ulong base,ulong size,uint type);
51
52 /* External assembler helper functions */
53
54 ibool   _ASMAPI _MTRR_isRing0(void);
55 ulong   _ASMAPI _MTRR_disableInt(void);
56 void    _ASMAPI _MTRR_restoreInt(ulong flags);
57 ulong   _ASMAPI _MTRR_saveCR4(void);
58 void    _ASMAPI _MTRR_restoreCR4(ulong cr4Val);
59 uchar   _ASMAPI _MTRR_getCx86(uchar reg);
60 void    _ASMAPI _MTRR_setCx86(uchar reg,uchar data);
61 #ifdef  __16BIT__
62 void    _ASMAPI _MTRR_readMSR(ulong reg, ulong far *eax, ulong far *edx);
63 #else
64 void    _ASMAPI _MTRR_readMSR(ulong reg, ulong *eax, ulong *edx);
65 #endif
66 void    _ASMAPI _MTRR_writeMSR(ulong reg, ulong eax, ulong edx);
67
68 #ifdef  __cplusplus
69 }                       /* End of "C" linkage for C++   */
70 #endif
71
72 #endif  /* __MTRR_H */