14478Skz151634 /* 24478Skz151634 * CDDL HEADER START 34478Skz151634 * 44478Skz151634 * The contents of this file are subject to the terms of the 54478Skz151634 * Common Development and Distribution License (the "License"). 64478Skz151634 * You may not use this file except in compliance with the License. 74478Skz151634 * 84478Skz151634 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 94478Skz151634 * or http://www.opensolaris.org/os/licensing. 104478Skz151634 * See the License for the specific language governing permissions 114478Skz151634 * and limitations under the License. 124478Skz151634 * 134478Skz151634 * When distributing Covered Code, include this CDDL HEADER in each 144478Skz151634 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 154478Skz151634 * If applicable, add the following below this CDDL HEADER, with the 164478Skz151634 * fields enclosed by brackets "[]" replaced with your own identifying 174478Skz151634 * information: Portions Copyright [yyyy] [name of copyright owner] 184478Skz151634 * 194478Skz151634 * CDDL HEADER END 204478Skz151634 */ 214478Skz151634 220Sstevel@tonic-gate /* 2311260SMiao.Chen@Sun.COM * Copyright (c) 2009, Intel Corporation. 2411260SMiao.Chen@Sun.COM * All Rights Reserved. 2511260SMiao.Chen@Sun.COM */ 2611260SMiao.Chen@Sun.COM 2711260SMiao.Chen@Sun.COM /* 288832SMiao.Chen@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 290Sstevel@tonic-gate * Use is subject to license terms. 300Sstevel@tonic-gate */ 310Sstevel@tonic-gate 320Sstevel@tonic-gate #ifndef _SYS_AGPDEFS_H 330Sstevel@tonic-gate #define _SYS_AGPDEFS_H 340Sstevel@tonic-gate 350Sstevel@tonic-gate #ifdef __cplusplus 360Sstevel@tonic-gate extern "C" { 370Sstevel@tonic-gate #endif 380Sstevel@tonic-gate 390Sstevel@tonic-gate /* 404478Skz151634 * This AGP memory type is required by some hardware like i810 video 410Sstevel@tonic-gate * card, which need physical contiguous pages to setup hardware cursor. 420Sstevel@tonic-gate * Usually, several tens of kilo bytes are needed in this case. 430Sstevel@tonic-gate * We use DDI DMA interfaces to allocate such memory in agpgart driver, 440Sstevel@tonic-gate * and it can not be exported to user applications directly by calling mmap 450Sstevel@tonic-gate * on agpgart driver. The typical usage scenario is as the following: 460Sstevel@tonic-gate * Firstly, Xserver get the memory physical address by calling AGPIOC_ALLOCATE 470Sstevel@tonic-gate * on agpgart driver. Secondly, Xserver use the physical address to mmap 480Sstevel@tonic-gate * the memory to Xserver space area by xsvc driver. 490Sstevel@tonic-gate * 500Sstevel@tonic-gate */ 510Sstevel@tonic-gate #define AGP_PHYSICAL 2 /* Only used for i810, HW curosr */ 520Sstevel@tonic-gate 530Sstevel@tonic-gate #ifdef _KERNEL 540Sstevel@tonic-gate 550Sstevel@tonic-gate /* AGP space units */ 560Sstevel@tonic-gate #define AGP_PAGE_SHIFT 12 570Sstevel@tonic-gate #define AGP_PAGE_SIZE (1 << AGP_PAGE_SHIFT) 580Sstevel@tonic-gate #define AGP_PAGE_OFFSET (AGP_PAGE_SIZE - 1) 590Sstevel@tonic-gate #define AGP_MB2PAGES(x) ((x) << 8) 600Sstevel@tonic-gate #define AGP_PAGES2BYTES(x) ((x) << AGP_PAGE_SHIFT) 610Sstevel@tonic-gate #define AGP_BYTES2PAGES(x) ((x) >> AGP_PAGE_SHIFT) 620Sstevel@tonic-gate #define AGP_PAGES2KB(x) ((x) << 2) 630Sstevel@tonic-gate #define AGP_ALIGNED(offset) (((offset) & AGP_PAGE_OFFSET) == 0) 640Sstevel@tonic-gate 650Sstevel@tonic-gate /* stand pci register offset */ 660Sstevel@tonic-gate #define PCI_CONF_CAP_MASK 0x10 670Sstevel@tonic-gate #define PCI_CONF_CAPID_MASK 0xff 680Sstevel@tonic-gate #define PCI_CONF_NCAPID_MASK 0xff00 690Sstevel@tonic-gate 700Sstevel@tonic-gate #define INTEL_VENDOR_ID 0x8086 710Sstevel@tonic-gate #define AMD_VENDOR_ID 0x1022 720Sstevel@tonic-gate #define VENDOR_ID_MASK 0xffff 730Sstevel@tonic-gate 740Sstevel@tonic-gate /* macros for device types */ 750Sstevel@tonic-gate #define DEVICE_IS_I810 11 /* intel i810 series video card */ 760Sstevel@tonic-gate #define DEVICE_IS_I830 12 /* intel i830, i845, i855 series */ 770Sstevel@tonic-gate #define DEVICE_IS_AGP 21 /* external AGP video card */ 780Sstevel@tonic-gate #define CHIP_IS_INTEL 10 /* intel agp bridge */ 790Sstevel@tonic-gate #define CHIP_IS_AMD 20 /* amd agp bridge */ 800Sstevel@tonic-gate 810Sstevel@tonic-gate /* AGP bridge device id */ 820Sstevel@tonic-gate #define AMD_BR_8151 0x74541022 830Sstevel@tonic-gate #define INTEL_BR_810 0x71208086 840Sstevel@tonic-gate #define INTEL_BR_810DC 0x71228086 850Sstevel@tonic-gate #define INTEL_BR_810E 0x71248086 860Sstevel@tonic-gate #define INTEL_BR_815 0x11308086 /* include 815G/EG/P/EP */ 870Sstevel@tonic-gate #define INTEL_BR_830M 0x35758086 880Sstevel@tonic-gate #define INTEL_BR_845 0x25608086 /* include 845G/P */ 890Sstevel@tonic-gate #define INTEL_BR_855GM 0x35808086 /* include 852GM/PM */ 900Sstevel@tonic-gate #define INTEL_BR_855PM 0x33408086 910Sstevel@tonic-gate #define INTEL_BR_865 0x25708086 924478Skz151634 #define INTEL_BR_915 0x25808086 934478Skz151634 #define INTEL_BR_915GM 0x25908086 943198Szw161486 #define INTEL_BR_945 0x27708086 954303Skz151634 #define INTEL_BR_945GM 0x27a08086 968020SMiao.Chen@Sun.COM #define INTEL_BR_945GME 0x27ac8086 974478Skz151634 #define INTEL_BR_946GZ 0x29708086 984478Skz151634 #define INTEL_BR_965G1 0x29808086 994478Skz151634 #define INTEL_BR_965Q 0x29908086 1004478Skz151634 #define INTEL_BR_965G2 0x29a08086 1014478Skz151634 #define INTEL_BR_965GM 0x2a008086 1024618Skz151634 #define INTEL_BR_965GME 0x2a108086 1035036Skz151634 #define INTEL_BR_Q35 0x29b08086 1045036Skz151634 #define INTEL_BR_G33 0x29c08086 1055036Skz151634 #define INTEL_BR_Q33 0x29d08086 1066778Smc196098 #define INTEL_BR_GM45 0x2a408086 1077662SMiao.Chen@Sun.COM #define INTEL_BR_EL 0x2e008086 1087662SMiao.Chen@Sun.COM #define INTEL_BR_Q45 0x2e108086 1097662SMiao.Chen@Sun.COM #define INTEL_BR_G45 0x2e208086 1108832SMiao.Chen@Sun.COM #define INTEL_BR_G41 0x2e308086 111*11359SMiao.Chen@Sun.COM #define INTEL_BR_IGDNG_D 0x00408086 112*11359SMiao.Chen@Sun.COM #define INTEL_BR_IGDNG_M 0x00448086 113*11359SMiao.Chen@Sun.COM #define INTEL_BR_IGDNG_MA 0x00628086 114*11359SMiao.Chen@Sun.COM #define INTEL_BR_IGDNG_MC2 0x006a8086 11511260SMiao.Chen@Sun.COM #define INTEL_BR_B43 0x2e408086 1160Sstevel@tonic-gate 1170Sstevel@tonic-gate /* AGP common register offset in pci configuration space */ 1180Sstevel@tonic-gate #define AGP_CONF_MISC 0x51 /* one byte */ 1190Sstevel@tonic-gate #define AGP_CONF_CAPPTR 0x34 1200Sstevel@tonic-gate #define AGP_CONF_APERBASE 0x10 1210Sstevel@tonic-gate #define AGP_CONF_STATUS 0x04 /* CAP + 0x4 */ 1220Sstevel@tonic-gate #define AGP_CONF_COMMAND 0x08 /* CAP + 0x8 */ 1230Sstevel@tonic-gate 1240Sstevel@tonic-gate /* AGP target register and mask defines */ 1250Sstevel@tonic-gate #define AGP_CONF_CONTROL 0x10 /* CAP + 0x10 */ 1260Sstevel@tonic-gate #define AGP_TARGET_BAR1 1 1270Sstevel@tonic-gate #define AGP_32_APERBASE_MASK 0xffc00000 /* 4M aligned */ 1280Sstevel@tonic-gate #define AGP_64_APERBASE_MASK 0xffffc00000LL /* 4M aligned */ 1290Sstevel@tonic-gate #define AGP_CONF_APERSIZE 0x14 /* CAP + 0x14 */ 1300Sstevel@tonic-gate #define AGP_CONF_ATTBASE 0x18 /* CAP + 0x18 */ 1310Sstevel@tonic-gate #define AGP_ATTBASE_MASK 0xfffff000 1320Sstevel@tonic-gate #define AGPCTRL_GTLBEN (0x1 << 7) 1330Sstevel@tonic-gate #define AGP_APER_TYPE_MASK 0x4 1340Sstevel@tonic-gate #define AGP_APER_SIZE_MASK 0xf00 1350Sstevel@tonic-gate #define AGP_APER_128M_MASK 0x3f 1360Sstevel@tonic-gate #define AGP_APER_4G_MASK 0xf00 1370Sstevel@tonic-gate #define AGP_APER_4M 0x3f 1380Sstevel@tonic-gate #define AGP_APER_8M 0x3e 1390Sstevel@tonic-gate #define AGP_APER_16M 0x3c 1400Sstevel@tonic-gate #define AGP_APER_32M 0x38 1410Sstevel@tonic-gate #define AGP_APER_64M 0x30 1420Sstevel@tonic-gate #define AGP_APER_128M 0x20 1430Sstevel@tonic-gate #define AGP_APER_256M 0xf00 1440Sstevel@tonic-gate #define AGP_APER_512M 0xe00 1450Sstevel@tonic-gate #define AGP_APER_1024M 0xc00 1460Sstevel@tonic-gate #define AGP_APER_2048M 0x800 1470Sstevel@tonic-gate #define AGP_APER_4G 0x000 1480Sstevel@tonic-gate #define AGP_MISC_APEN 0x2 1490Sstevel@tonic-gate 1500Sstevel@tonic-gate /* AGP gart table definition */ 1510Sstevel@tonic-gate #define AGP_ENTRY_VALID 0x1 1520Sstevel@tonic-gate 1530Sstevel@tonic-gate /* AGP term definitions */ 1540Sstevel@tonic-gate #define AGP_CAP_ID 0x2 1550Sstevel@tonic-gate #define AGP_CAP_OFF_DEF 0xa0 1560Sstevel@tonic-gate 1570Sstevel@tonic-gate /* Intel integrated video card, chipset id */ 1580Sstevel@tonic-gate #define INTEL_IGD_810 0x71218086 1590Sstevel@tonic-gate #define INTEL_IGD_810DC 0x71238086 1600Sstevel@tonic-gate #define INTEL_IGD_810E 0x71258086 1610Sstevel@tonic-gate #define INTEL_IGD_815 0x11328086 1620Sstevel@tonic-gate #define INTEL_IGD_830M 0x35778086 1630Sstevel@tonic-gate #define INTEL_IGD_845G 0x25628086 1640Sstevel@tonic-gate #define INTEL_IGD_855GM 0x35828086 1650Sstevel@tonic-gate #define INTEL_IGD_865G 0x25728086 1664478Skz151634 #define INTEL_IGD_915 0x25828086 1674478Skz151634 #define INTEL_IGD_915GM 0x25928086 1683198Szw161486 #define INTEL_IGD_945 0x27728086 1694303Skz151634 #define INTEL_IGD_945GM 0x27a28086 1708020SMiao.Chen@Sun.COM #define INTEL_IGD_945GME 0x27ae8086 1714478Skz151634 #define INTEL_IGD_946GZ 0x29728086 1724478Skz151634 #define INTEL_IGD_965G1 0x29828086 1734478Skz151634 #define INTEL_IGD_965Q 0x29928086 1744478Skz151634 #define INTEL_IGD_965G2 0x29a28086 1754478Skz151634 #define INTEL_IGD_965GM 0x2a028086 1764618Skz151634 #define INTEL_IGD_965GME 0x2a128086 1775036Skz151634 #define INTEL_IGD_Q35 0x29b28086 1785036Skz151634 #define INTEL_IGD_G33 0x29c28086 1795036Skz151634 #define INTEL_IGD_Q33 0x29d28086 1806778Smc196098 #define INTEL_IGD_GM45 0x2a428086 1817662SMiao.Chen@Sun.COM #define INTEL_IGD_EL 0x2e028086 1827662SMiao.Chen@Sun.COM #define INTEL_IGD_Q45 0x2e128086 1837662SMiao.Chen@Sun.COM #define INTEL_IGD_G45 0x2e228086 1848832SMiao.Chen@Sun.COM #define INTEL_IGD_G41 0x2e328086 185*11359SMiao.Chen@Sun.COM #define INTEL_IGD_IGDNG_D 0x00428086 186*11359SMiao.Chen@Sun.COM #define INTEL_IGD_IGDNG_M 0x00468086 18711260SMiao.Chen@Sun.COM #define INTEL_IGD_B43 0x2e428086 18811260SMiao.Chen@Sun.COM 18911260SMiao.Chen@Sun.COM /* Intel 915 and 945 series */ 19011260SMiao.Chen@Sun.COM #define IS_INTEL_915(device) ((device == INTEL_IGD_915) || \ 19111260SMiao.Chen@Sun.COM (device == INTEL_IGD_915GM) || \ 19211260SMiao.Chen@Sun.COM (device == INTEL_IGD_945) || \ 19311260SMiao.Chen@Sun.COM (device == INTEL_IGD_945GM) || \ 19411260SMiao.Chen@Sun.COM (device == INTEL_IGD_945GME)) 19511260SMiao.Chen@Sun.COM 19611260SMiao.Chen@Sun.COM /* Intel 965 series */ 19711260SMiao.Chen@Sun.COM #define IS_INTEL_965(device) ((device == INTEL_IGD_946GZ) || \ 19811260SMiao.Chen@Sun.COM (device == INTEL_IGD_965G1) || \ 19911260SMiao.Chen@Sun.COM (device == INTEL_IGD_965Q) || \ 20011260SMiao.Chen@Sun.COM (device == INTEL_IGD_965G2) || \ 20111260SMiao.Chen@Sun.COM (device == INTEL_IGD_965GM) || \ 20211260SMiao.Chen@Sun.COM (device == INTEL_IGD_965GME) || \ 20311260SMiao.Chen@Sun.COM (device == INTEL_IGD_GM45) || \ 20411260SMiao.Chen@Sun.COM IS_INTEL_G4X(device)) 20511260SMiao.Chen@Sun.COM 20611260SMiao.Chen@Sun.COM /* Intel G33 series */ 20711260SMiao.Chen@Sun.COM #define IS_INTEL_X33(device) ((device == INTEL_IGD_Q35) || \ 20811260SMiao.Chen@Sun.COM (device == INTEL_IGD_G33) || \ 20911260SMiao.Chen@Sun.COM (device == INTEL_IGD_Q33)) 21011260SMiao.Chen@Sun.COM 211*11359SMiao.Chen@Sun.COM /* IGDNG */ 212*11359SMiao.Chen@Sun.COM #define IS_IGDNG(device) ((device == INTEL_IGD_IGDNG_D) || \ 213*11359SMiao.Chen@Sun.COM (device == INTEL_IGD_IGDNG_M)) 214*11359SMiao.Chen@Sun.COM 21511260SMiao.Chen@Sun.COM /* Intel G4X series */ 21611260SMiao.Chen@Sun.COM #define IS_INTEL_G4X(device) ((device == INTEL_IGD_EL) || \ 21711260SMiao.Chen@Sun.COM (device == INTEL_IGD_Q45) || \ 21811260SMiao.Chen@Sun.COM (device == INTEL_IGD_G45) || \ 21911260SMiao.Chen@Sun.COM (device == INTEL_IGD_G41) || \ 220*11359SMiao.Chen@Sun.COM IS_IGDNG(device) || \ 22111260SMiao.Chen@Sun.COM (device == INTEL_IGD_B43)) 2226778Smc196098 2235036Skz151634 /* register offsets in PCI config space */ 2245036Skz151634 #define I8XX_CONF_GMADR 0x10 /* GMADR of i8xx series */ 2255036Skz151634 #define I915_CONF_GMADR 0x18 /* GMADR of i915 series */ 2265036Skz151634 /* (Mirror) GMCH Graphics Control Register (GGC, MGGC) */ 2275036Skz151634 #define I8XX_CONF_GC 0x52 2280Sstevel@tonic-gate 2290Sstevel@tonic-gate /* Intel integrated video card graphics mode mask */ 2300Sstevel@tonic-gate #define I8XX_GC_MODE_MASK 0x70 2315036Skz151634 #define IX33_GC_MODE_MASK 0xf0 2325036Skz151634 /* GTT Graphics Memory Size (9:8) in GMCH Graphics Control Register */ 2335036Skz151634 #define IX33_GGMS_MASK 0x300 2345036Skz151634 /* No VT mode, 1MB allocated for GTT */ 2355036Skz151634 #define IX33_GGMS_1M 0x100 2365036Skz151634 /* VT mode, 2MB allocated for GTT */ 2375036Skz151634 #define IX33_GGMS_2M 0x200 2380Sstevel@tonic-gate 2390Sstevel@tonic-gate /* Intel integrated video card GTT definition */ 2400Sstevel@tonic-gate #define GTT_PAGE_SHIFT 12 2410Sstevel@tonic-gate #define GTT_PAGE_SIZE (1 << GTT_PAGE_SHIFT) 2420Sstevel@tonic-gate #define GTT_PAGE_OFFSET (GTT_PAGE_SIZE - 1) 2430Sstevel@tonic-gate #define GTT_PTE_MASK (~GTT_PAGE_OFFSET) 2440Sstevel@tonic-gate #define GTT_PTE_VALID 0x1 2450Sstevel@tonic-gate #define GTT_TABLE_VALID 0x1 2460Sstevel@tonic-gate #define GTT_BASE_MASK 0xfffff000 2470Sstevel@tonic-gate #define GTT_MB_TO_PAGES(m) ((m) << 8) 2486742Sms148562 #define GTT_POINTER_MASK 0xffffffff00000000 2490Sstevel@tonic-gate 2500Sstevel@tonic-gate /* Intel i810 register offset */ 2516742Sms148562 #define I810_POINTER_MASK 0xffffffffc0000000 2520Sstevel@tonic-gate #define I810_CONF_SMRAM 0x70 /* offset in PCI config space */ 2530Sstevel@tonic-gate #define I810_GMS_MASK 0xc0 /* smram register mask */ 2540Sstevel@tonic-gate /* 2550Sstevel@tonic-gate * GART and GTT entry format table 2560Sstevel@tonic-gate * 2570Sstevel@tonic-gate * AMD64 GART entry 2580Sstevel@tonic-gate * from bios and kernel develop guide for amd64 2590Sstevel@tonic-gate * ----------------------------- 2600Sstevel@tonic-gate * Bits Description | 2610Sstevel@tonic-gate * 0 valid | 2620Sstevel@tonic-gate * 1 coherent | 2630Sstevel@tonic-gate * 3:2 reserved | 2640Sstevel@tonic-gate * 11:4 physaddr[39:32] | 2650Sstevel@tonic-gate * 31:12 physaddr[31:12] | 2660Sstevel@tonic-gate * ----------------------------- 2670Sstevel@tonic-gate * Intel GTT entry 2680Sstevel@tonic-gate * Intel video programming manual 2690Sstevel@tonic-gate * ----------------------------- 2700Sstevel@tonic-gate * Bits descrition | 2710Sstevel@tonic-gate * 0 valid | 2720Sstevel@tonic-gate * 2:1 memory type | 2730Sstevel@tonic-gate * 29:12 PhysAddr[29:12] | 2740Sstevel@tonic-gate * 31:30 reserved | 2750Sstevel@tonic-gate * ----------------------------- 2760Sstevel@tonic-gate * AGP entry 2770Sstevel@tonic-gate * from AGP protocol 3.0 2780Sstevel@tonic-gate * ----------------------------- 2790Sstevel@tonic-gate * Bits descrition | 2800Sstevel@tonic-gate * 0 valid | 2810Sstevel@tonic-gate * 1 coherent | 2820Sstevel@tonic-gate * 3:2 reserved | 2830Sstevel@tonic-gate * 11:4 PhysAddr[39:32] | 2840Sstevel@tonic-gate * 31:12 PhysAddr[31:12] | 2850Sstevel@tonic-gate * 63:32 PhysAddr[71:40] | 2860Sstevel@tonic-gate * ----------------------------- 2870Sstevel@tonic-gate */ 2880Sstevel@tonic-gate 2890Sstevel@tonic-gate /* 2900Sstevel@tonic-gate * gart and gtt table base register format 2910Sstevel@tonic-gate * 2920Sstevel@tonic-gate * AMD64 register format 2930Sstevel@tonic-gate * from bios and kernel develop guide for AMD64 2940Sstevel@tonic-gate * --------------------------------------------- 2950Sstevel@tonic-gate * Bits Description | 2960Sstevel@tonic-gate * 3:0 reserved | 2970Sstevel@tonic-gate * 31:4 physical addr 39:12 | 2980Sstevel@tonic-gate * ---------------------------------------------- 2990Sstevel@tonic-gate * INTEL AGPGART table base register format 3000Sstevel@tonic-gate * from AGP protocol 3.0 p142, only support 32 bits 3010Sstevel@tonic-gate * --------------------------------------------- 3020Sstevel@tonic-gate * Bits Description | 3030Sstevel@tonic-gate * 11:0 reserved | 3040Sstevel@tonic-gate * 31:12 physical addr 31:12 | 3050Sstevel@tonic-gate * 63:32 physical addr 63:32 | 3060Sstevel@tonic-gate * --------------------------------------------- 3070Sstevel@tonic-gate * INTEL i810 GTT table base register format 3080Sstevel@tonic-gate * _____________________________________________ 3090Sstevel@tonic-gate * Bits Description | 3100Sstevel@tonic-gate * 0 GTT table enable bit | 3110Sstevel@tonic-gate * 11:1 reserved | 3120Sstevel@tonic-gate * 31:12 physical addr 31:12 | 3130Sstevel@tonic-gate * --------------------------------------------- 3140Sstevel@tonic-gate */ 3150Sstevel@tonic-gate 3160Sstevel@tonic-gate /* Intel agp bridge specific */ 3176742Sms148562 #define AGP_INTEL_POINTER_MASK 0xffffffff00000000 3180Sstevel@tonic-gate 3190Sstevel@tonic-gate /* Amd64 cpu gart device reigster offset */ 3200Sstevel@tonic-gate #define AMD64_APERTURE_CONTROL 0x90 3210Sstevel@tonic-gate #define AMD64_APERTURE_BASE 0x94 3220Sstevel@tonic-gate #define AMD64_GART_CACHE_CTL 0x9c 3230Sstevel@tonic-gate #define AMD64_GART_BASE 0x98 3240Sstevel@tonic-gate 3250Sstevel@tonic-gate /* Amd64 cpu gart bits */ 3260Sstevel@tonic-gate #define AMD64_APERBASE_SHIFT 25 3270Sstevel@tonic-gate #define AMD64_APERBASE_MASK 0x00007fff 3280Sstevel@tonic-gate #define AMD64_GARTBASE_SHIFT 8 3290Sstevel@tonic-gate #define AMD64_GARTBASE_MASK 0xfffffff0 3306742Sms148562 #define AMD64_POINTER_MASK 0xffffff0000000000 3310Sstevel@tonic-gate #define AMD64_INVALID_CACHE 0x1 3320Sstevel@tonic-gate #define AMD64_GART_SHIFT 12 3330Sstevel@tonic-gate #define AMD64_RESERVE_SHIFT 4 3340Sstevel@tonic-gate #define AMD64_APERSIZE_MASK 0xe 3350Sstevel@tonic-gate #define AMD64_GARTEN 0x1 3360Sstevel@tonic-gate #define AMD64_DISGARTCPU 0x10 3370Sstevel@tonic-gate #define AMD64_DISGARTIO 0x20 3380Sstevel@tonic-gate #define AMD64_ENTRY_VALID 0x1 3390Sstevel@tonic-gate 3400Sstevel@tonic-gate /* Other common routines */ 3410Sstevel@tonic-gate #define MB2BYTES(m) ((m) << 20) 3420Sstevel@tonic-gate #define BYTES2MB(m) ((m) >> 20) 3430Sstevel@tonic-gate #define GIGA_MASK 0xC0000000 3440Sstevel@tonic-gate #define UI32_MASK 0xffffffffU 345417Sms148562 #define MAXAPERMEGAS 0x1000 /* Aper size no more than 4G */ 34611260SMiao.Chen@Sun.COM #define MINAPERMEGAS 192 3470Sstevel@tonic-gate 3480Sstevel@tonic-gate #endif /* _KERNEL */ 3490Sstevel@tonic-gate 3500Sstevel@tonic-gate #ifdef __cplusplus 3510Sstevel@tonic-gate } 3520Sstevel@tonic-gate #endif 3530Sstevel@tonic-gate 3540Sstevel@tonic-gate #endif /* _SYS_AGPDEFS_H */ 355