1 /***************************************************************************\
3 |* Copyright 1993-2003 NVIDIA, Corporation. All rights reserved. *|
5 |* NOTICE TO USER: The source code is copyrighted under U.S. and *|
6 |* international laws. Users and possessors of this source code are *|
7 |* hereby granted a nonexclusive, royalty-free copyright license to *|
8 |* use this code in individual and commercial software. *|
10 |* Any use of this source code must include, in the user documenta- *|
11 |* tion and internal comments to the code, notices to the end user *|
14 |* Copyright 1993-1999 NVIDIA, Corporation. All rights reserved. *|
16 |* NVIDIA, CORPORATION MAKES NO REPRESENTATION ABOUT THE SUITABILITY *|
17 |* OF THIS SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" *|
18 |* WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. NVIDIA, CORPOR- *|
19 |* ATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOURCE CODE, *|
20 |* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGE- *|
21 |* MENT, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL *|
22 |* NVIDIA, CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT, INCI- *|
23 |* DENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RE- *|
24 |* SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION *|
25 |* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *|
26 |* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
28 |* U.S. Government End Users. This source code is a "commercial *|
29 |* item," as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
30 |* consisting of "commercial computer software" and "commercial *|
31 |* computer software documentation," as such terms are used in *|
32 |* 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Govern- *|
33 |* ment only as a commercial end item. Consistent with 48 C.F.R. *|
34 |* 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
35 |* all U.S. Government End Users acquire the source code with only *|
36 |* those rights set forth herein. *|
38 \***************************************************************************/
39 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_local.h,v 1.8tsi Exp $ */
41 #ifndef __NV_LOCAL_H__
42 #define __NV_LOCAL_H__
45 * This file includes any environment or machine specific values to access the
46 * HW. Put all affected includes, typdefs, etc. here so the riva_hw.* files
47 * can stay generic in nature.
50 #include "xf86_OSproc.h"
52 //#define NOUVEAU_MODESET_TRACE
53 #ifdef NOUVEAU_MODESET_TRACE
54 #define DDXMMIOH(f, h, r, v) ErrorF(f, h, r, v)
55 #define DDXMMIOW(f, r, w) (ErrorF(f, r, w), w)
57 #define DDXMMIOH(f, h, r, v)
58 #define DDXMMIOW(f, r, w) w
62 * HW access macros. These assume memory-mapped I/O, and not normal I/O space.
64 #define NV_WR08(p,i,d) MMIO_OUT8((pointer)(p), (i), (d))
65 #define NV_RD08(p,i) MMIO_IN8((pointer)(p), (i))
66 #define NV_WR16(p,i,d) MMIO_OUT16((pointer)(p), (i), (d))
67 #define NV_RD16(p,i) MMIO_IN16((pointer)(p), (i))
68 #define NV_WR32(p,i,d) MMIO_OUT32((pointer)(p), (i), (d))
69 #define NV_RD32(p,i) MMIO_IN32((pointer)(p), (i))
71 /* VGA I/O is now always done through MMIO */
72 #define VGA_WR08(p,i,d) NV_WR08(p, i, DDXMMIOW("VGA_WR08 port 0x%04x val 0x%02x\n", i, d))
73 #define VGA_RD08(p,i) DDXMMIOW("VGA_RD08 port 0x%04x val 0x%02x\n", i, NV_RD08(p,i))
75 static inline int log2i(int i)
103 #endif /* __NV_LOCAL_H__ */