diff options
Diffstat (limited to 'xorg-server/hw/xfree86/os-support')
-rw-r--r-- | xorg-server/hw/xfree86/os-support/bsd/Makefile.am | 152 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/hurd/Makefile.am | 30 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/hurd/hurd_bell.c | 74 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/int10Defines.h | 178 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/linux/int10/linux.c | 29 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c | 16 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/misc/Makefile.am | 24 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/solaris/Makefile.am | 74 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar | 1612 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S | 134 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S | 134 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S | 276 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/solaris/sun_inout.s | 248 |
13 files changed, 1490 insertions, 1491 deletions
diff --git a/xorg-server/hw/xfree86/os-support/bsd/Makefile.am b/xorg-server/hw/xfree86/os-support/bsd/Makefile.am index b6ecdf1d1..55eb1151d 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/Makefile.am +++ b/xorg-server/hw/xfree86/os-support/bsd/Makefile.am @@ -1,76 +1,76 @@ -noinst_LTLIBRARIES = libbsd.la - -# APM support. -if BSD_KQUEUE_APM -APM_SOURCES = $(srcdir)/bsd_kqueue_apm.c -else -if BSD_APM -APM_SOURCES = $(srcdir)/bsd_apm.c -else -APM_SOURCES = $(srcdir)/../shared/pm_noop.c -endif -endif - -if FREEBSD_KLDLOAD -KMOD_SOURCES = bsd_kmod.c -else -KMOD_SOURCES = $(srcdir)/../shared/kmod_noop.c -endif - -if AGP -AGP_SOURCES = $(srcdir)/../linux/lnx_agp.c -else -AGP_SOURCES = $(srcdir)/../shared/agp_noop.c -endif - -if ALPHA_VIDEO -# Cheat here and piggyback other alpha bits on ALPHA_VIDEO. -ARCH_SOURCES = \ - alpha_video.c \ - bsd_ev56.c \ - bsd_axp.c \ - $(srcdir)/../shared/xf86Axp.c -endif - -if ARM_VIDEO -ARCH_SOURCES = arm_video.c -endif - -if I386_VIDEO -ARCH_SOURCES = i386_video.c -endif - -if PPC_VIDEO -ARCH_SOURCES = ppc_video.c -endif - -if SPARC64_VIDEO -# Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO. -ARCH_SOURCES = \ - sparc64_video.c \ - $(srcdir)/../shared/ioperm_noop.c -endif - -# FIXME: NetBSD Aperture defines (configure.ac) -AM_CFLAGS = -DUSESTDRES $(XORG_CFLAGS) $(DIX_CFLAGS) - -INCLUDES = $(XORG_INCS) - -libbsd_la_SOURCES = \ - $(srcdir)/../shared/posix_tty.c \ - $(srcdir)/../shared/sigio.c \ - $(srcdir)/../shared/vidmem.c \ - bsd_VTsw.c \ - bsd_init.c \ - bsd_bell.c \ - $(ARCH_SOURCES) \ - $(AGP_SOURCES) \ - $(APM_SOURCES) \ - $(AXP_SOURCES) \ - $(DRI_SOURCES) \ - $(KMOD_SOURCES) \ - $(RES_SOURCES) - -# FIXME: Add these files to the build as needed -EXTRA_DIST = \ - memrange.h +noinst_LTLIBRARIES = libbsd.la
+
+# APM support.
+if BSD_KQUEUE_APM
+APM_SOURCES = $(srcdir)/bsd_kqueue_apm.c
+else
+if BSD_APM
+APM_SOURCES = $(srcdir)/bsd_apm.c
+else
+APM_SOURCES = $(srcdir)/../shared/pm_noop.c
+endif
+endif
+
+if FREEBSD_KLDLOAD
+KMOD_SOURCES = bsd_kmod.c
+else
+KMOD_SOURCES = $(srcdir)/../shared/kmod_noop.c
+endif
+
+if AGP
+AGP_SOURCES = $(srcdir)/../linux/lnx_agp.c
+else
+AGP_SOURCES = $(srcdir)/../shared/agp_noop.c
+endif
+
+if ALPHA_VIDEO
+# Cheat here and piggyback other alpha bits on ALPHA_VIDEO.
+ARCH_SOURCES = \
+ alpha_video.c \
+ bsd_ev56.c \
+ bsd_axp.c \
+ $(srcdir)/../shared/xf86Axp.c
+endif
+
+if ARM_VIDEO
+ARCH_SOURCES = arm_video.c
+endif
+
+if I386_VIDEO
+ARCH_SOURCES = i386_video.c
+endif
+
+if PPC_VIDEO
+ARCH_SOURCES = ppc_video.c
+endif
+
+if SPARC64_VIDEO
+# Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO.
+ARCH_SOURCES = \
+ sparc64_video.c \
+ $(srcdir)/../shared/ioperm_noop.c
+endif
+
+# FIXME: NetBSD Aperture defines (configure.ac)
+AM_CFLAGS = -DUSESTDRES $(XORG_CFLAGS) $(DIX_CFLAGS)
+
+INCLUDES = $(XORG_INCS)
+
+libbsd_la_SOURCES = \
+ $(srcdir)/../shared/posix_tty.c \
+ $(srcdir)/../shared/sigio.c \
+ $(srcdir)/../shared/vidmem.c \
+ bsd_VTsw.c \
+ bsd_init.c \
+ bsd_bell.c \
+ $(ARCH_SOURCES) \
+ $(AGP_SOURCES) \
+ $(APM_SOURCES) \
+ $(AXP_SOURCES) \
+ $(DRI_SOURCES) \
+ $(KMOD_SOURCES) \
+ $(RES_SOURCES)
+
+# FIXME: Add these files to the build as needed
+EXTRA_DIST = \
+ memrange.h
diff --git a/xorg-server/hw/xfree86/os-support/hurd/Makefile.am b/xorg-server/hw/xfree86/os-support/hurd/Makefile.am index 3e8224753..2f0ba2ac8 100644 --- a/xorg-server/hw/xfree86/os-support/hurd/Makefile.am +++ b/xorg-server/hw/xfree86/os-support/hurd/Makefile.am @@ -1,15 +1,15 @@ -noinst_LTLIBRARIES = libhurd.la - -libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \ - hurd_video.c \ - $(srcdir)/../shared/VTsw_noop.c \ - $(srcdir)/../shared/posix_tty.c \ - $(srcdir)/../shared/vidmem.c \ - $(srcdir)/../shared/sigiostubs.c \ - $(srcdir)/../shared/pm_noop.c \ - $(srcdir)/../shared/kmod_noop.c \ - $(srcdir)/../shared/agp_noop.c - -AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS) - -INCLUDES = $(XORG_INCS) +noinst_LTLIBRARIES = libhurd.la
+
+libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \
+ hurd_video.c \
+ $(srcdir)/../shared/VTsw_noop.c \
+ $(srcdir)/../shared/posix_tty.c \
+ $(srcdir)/../shared/vidmem.c \
+ $(srcdir)/../shared/sigiostubs.c \
+ $(srcdir)/../shared/pm_noop.c \
+ $(srcdir)/../shared/kmod_noop.c \
+ $(srcdir)/../shared/agp_noop.c
+
+AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS)
+
+INCLUDES = $(XORG_INCS)
diff --git a/xorg-server/hw/xfree86/os-support/hurd/hurd_bell.c b/xorg-server/hw/xfree86/os-support/hurd/hurd_bell.c index 33965a44c..8750eaf44 100644 --- a/xorg-server/hw/xfree86/os-support/hurd/hurd_bell.c +++ b/xorg-server/hw/xfree86/os-support/hurd/hurd_bell.c @@ -1,37 +1,37 @@ -/* - * Copyright © 2006 Daniel Stone - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Author: Daniel Stone <daniel@fooishbar.org> - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include "xf86.h" -#include "xf86Priv.h" - -void -xf86OSRingBell(int loudness, int pitch, int duration) -{ - return; -} +/*
+ * Copyright © 2006 Daniel Stone
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel@fooishbar.org>
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86.h"
+#include "xf86Priv.h"
+
+void
+xf86OSRingBell(int loudness, int pitch, int duration)
+{
+ return;
+}
diff --git a/xorg-server/hw/xfree86/os-support/int10Defines.h b/xorg-server/hw/xfree86/os-support/int10Defines.h index d942fbdad..e79722839 100644 --- a/xorg-server/hw/xfree86/os-support/int10Defines.h +++ b/xorg-server/hw/xfree86/os-support/int10Defines.h @@ -1,89 +1,89 @@ -/* - * Copyright (c) 2000-2001 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#ifndef _INT10DEFINES_H_ -#define _INT10DEFINES_H_ 1 - -#ifdef _VM86_LINUX - -#include <asm/vm86.h> - -#define CPU_R(type,name,num) \ - (((type *)&(((struct vm86_struct *)REG->cpuRegs)->regs.name))[num]) -#define CPU_RD(name,num) CPU_R(CARD32,name,num) -#define CPU_RW(name,num) CPU_R(CARD16,name,num) -#define CPU_RB(name,num) CPU_R(CARD8,name,num) - -#define X86_EAX CPU_RD(eax,0) -#define X86_EBX CPU_RD(ebx,0) -#define X86_ECX CPU_RD(ecx,0) -#define X86_EDX CPU_RD(edx,0) -#define X86_ESI CPU_RD(esi,0) -#define X86_EDI CPU_RD(edi,0) -#define X86_EBP CPU_RD(ebp,0) -#define X86_EIP CPU_RD(eip,0) -#define X86_ESP CPU_RD(esp,0) -#define X86_EFLAGS CPU_RD(eflags,0) - -#define X86_FLAGS CPU_RW(eflags,0) -#define X86_AX CPU_RW(eax,0) -#define X86_BX CPU_RW(ebx,0) -#define X86_CX CPU_RW(ecx,0) -#define X86_DX CPU_RW(edx,0) -#define X86_SI CPU_RW(esi,0) -#define X86_DI CPU_RW(edi,0) -#define X86_BP CPU_RW(ebp,0) -#define X86_IP CPU_RW(eip,0) -#define X86_SP CPU_RW(esp,0) -#define X86_CS CPU_RW(cs,0) -#define X86_DS CPU_RW(ds,0) -#define X86_ES CPU_RW(es,0) -#define X86_SS CPU_RW(ss,0) -#define X86_FS CPU_RW(fs,0) -#define X86_GS CPU_RW(gs,0) - -#define X86_AL CPU_RB(eax,0) -#define X86_BL CPU_RB(ebx,0) -#define X86_CL CPU_RB(ecx,0) -#define X86_DL CPU_RB(edx,0) - -#define X86_AH CPU_RB(eax,1) -#define X86_BH CPU_RB(ebx,1) -#define X86_CH CPU_RB(ecx,1) -#define X86_DH CPU_RB(edx,1) - -#elif defined(_X86EMU) - -#include "xf86x86emu.h" - -#endif - -#endif +/*
+ * Copyright (c) 2000-2001 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifndef _INT10DEFINES_H_
+#define _INT10DEFINES_H_ 1
+
+#ifdef _VM86_LINUX
+
+#include <asm/vm86.h>
+
+#define CPU_R(type,name,num) \
+ (((type *)&(((struct vm86_struct *)REG->cpuRegs)->regs.name))[num])
+#define CPU_RD(name,num) CPU_R(CARD32,name,num)
+#define CPU_RW(name,num) CPU_R(CARD16,name,num)
+#define CPU_RB(name,num) CPU_R(CARD8,name,num)
+
+#define X86_EAX CPU_RD(eax,0)
+#define X86_EBX CPU_RD(ebx,0)
+#define X86_ECX CPU_RD(ecx,0)
+#define X86_EDX CPU_RD(edx,0)
+#define X86_ESI CPU_RD(esi,0)
+#define X86_EDI CPU_RD(edi,0)
+#define X86_EBP CPU_RD(ebp,0)
+#define X86_EIP CPU_RD(eip,0)
+#define X86_ESP CPU_RD(esp,0)
+#define X86_EFLAGS CPU_RD(eflags,0)
+
+#define X86_FLAGS CPU_RW(eflags,0)
+#define X86_AX CPU_RW(eax,0)
+#define X86_BX CPU_RW(ebx,0)
+#define X86_CX CPU_RW(ecx,0)
+#define X86_DX CPU_RW(edx,0)
+#define X86_SI CPU_RW(esi,0)
+#define X86_DI CPU_RW(edi,0)
+#define X86_BP CPU_RW(ebp,0)
+#define X86_IP CPU_RW(eip,0)
+#define X86_SP CPU_RW(esp,0)
+#define X86_CS CPU_RW(cs,0)
+#define X86_DS CPU_RW(ds,0)
+#define X86_ES CPU_RW(es,0)
+#define X86_SS CPU_RW(ss,0)
+#define X86_FS CPU_RW(fs,0)
+#define X86_GS CPU_RW(gs,0)
+
+#define X86_AL CPU_RB(eax,0)
+#define X86_BL CPU_RB(ebx,0)
+#define X86_CL CPU_RB(ecx,0)
+#define X86_DL CPU_RB(edx,0)
+
+#define X86_AH CPU_RB(eax,1)
+#define X86_BH CPU_RB(ebx,1)
+#define X86_CH CPU_RB(ecx,1)
+#define X86_DH CPU_RB(edx,1)
+
+#elif defined(_X86EMU)
+
+#include "xf86x86emu.h"
+
+#endif
+
+#endif
diff --git a/xorg-server/hw/xfree86/os-support/linux/int10/linux.c b/xorg-server/hw/xfree86/os-support/linux/int10/linux.c index fa58a72b6..8bca37524 100644 --- a/xorg-server/hw/xfree86/os-support/linux/int10/linux.c +++ b/xorg-server/hw/xfree86/os-support/linux/int10/linux.c @@ -52,7 +52,6 @@ typedef struct { int highMem; char *base; char *base_high; - int screen; char *alloc; } linuxInt10Priv; @@ -89,15 +88,16 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) memType cs; legacyVGARec vga; Bool videoBiosMapped = FALSE; - + ScrnInfoPtr pScrn; if (int10Generation != serverGeneration) { counter = 0; int10Generation = serverGeneration; } - screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex; + pScrn = xf86FindScreenForEntity(entityIndex); + screen = pScrn->scrnIndex; - options = xf86HandleInt10Options(xf86Screens[screen], entityIndex); + options = xf86HandleInt10Options(pScrn, entityIndex); if (int10skip(options)) { free(options); @@ -106,7 +106,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) #if defined DoSubModules if (loadedSubModule == INT10_NOT_LOADED) - loadedSubModule = int10LinuxLoadSubModule(xf86Screens[screen]); + loadedSubModule = int10LinuxLoadSubModule(pScrn); if (loadedSubModule == INT10_LOAD_FAILED) return NULL; @@ -145,7 +145,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) } pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec)); - pInt->scrnIndex = screen; + pInt->pScrn = pScrn; pInt->entityIndex = entityIndex; pInt->dev = xf86GetPciInfoForEntity(entityIndex); @@ -154,7 +154,6 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) pInt->mem = &linuxMem; pagesize = getpagesize(); pInt->private = (pointer) xnfcalloc(1, sizeof(linuxInt10Priv)); - ((linuxInt10Priv *) pInt->private)->screen = screen; ((linuxInt10Priv *) pInt->private)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(pagesize)); @@ -333,28 +332,28 @@ MapCurrentInt10(xf86Int10InfoPtr pInt) addr = shmat(((linuxInt10Priv *) pInt->private)->lowMem, (char *) 1, SHM_RND); if (addr == SHMERRORPTR) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() low memory\n"); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot shmat() low memory\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "shmat(low_mem) error: %s\n", strerror(errno)); return FALSE; } if (mprotect((void *) 0, V_RAM, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot set EXEC bit on low memory: %s\n", strerror(errno)); if (((linuxInt10Priv *) pInt->private)->highMem >= 0) { addr = shmat(((linuxInt10Priv *) pInt->private)->highMem, (char *) HIGH_MEM, 0); if (addr == SHMERRORPTR) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot shmat() high memory\n"); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "shmget error: %s\n", strerror(errno)); return FALSE; } if (mprotect((void *) HIGH_MEM, HIGH_MEM_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot set EXEC bit on high memory: %s\n", strerror(errno)); } @@ -364,13 +363,13 @@ MapCurrentInt10(xf86Int10InfoPtr pInt) PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED | MAP_FIXED, fd, V_BIOS) == MAP_FAILED) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot map V_BIOS\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot map V_BIOS\n"); close(fd); return FALSE; } } else { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM); return FALSE; } close(fd); diff --git a/xorg-server/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/xorg-server/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c index 8502b21b7..187698399 100644 --- a/xorg-server/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c +++ b/xorg-server/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c @@ -210,19 +210,19 @@ vm86_GP_fault(xf86Int10InfoPtr pInt) return FALSE; case 0x0f: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8lx\n", X86_CS, X86_EIP); goto op0ferr; default: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown reason for exception\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "unknown reason for exception\n"); op0ferr: dump_registers(pInt); stack_trace(pInt); dump_code(pInt); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "cannot continue\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "cannot continue\n"); return FALSE; } /* end of switch() */ return TRUE; @@ -238,7 +238,7 @@ do_vm86(xf86Int10InfoPtr pInt) xf86InterceptSignals(NULL); if (signo >= 0) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86() syscall generated signal %d.\n", signo); dump_registers(pInt); dump_code(pInt); @@ -252,7 +252,7 @@ do_vm86(xf86Int10InfoPtr pInt) return 0; break; case VM86_STI: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86_sti :-((\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86_sti :-((\n"); dump_registers(pInt); dump_code(pInt); stack_trace(pInt); @@ -260,7 +260,7 @@ do_vm86(xf86Int10InfoPtr pInt) case VM86_INTx: pInt->num = VM86_ARG(retval); if (!int_handler(pInt)) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval)); dump_registers(pInt); dump_code(pInt); @@ -275,10 +275,10 @@ do_vm86(xf86Int10InfoPtr pInt) * we used to warn here and bail out - but now the sigio stuff * always fires signals at us. So we just ignore them for now. */ - xf86DrvMsg(pInt->scrnIndex, X_WARNING, "received signal\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_WARNING, "received signal\n"); return 0; default: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n", + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n", VM86_ARG(retval), VM86_TYPE(retval)); dump_registers(pInt); dump_code(pInt); diff --git a/xorg-server/hw/xfree86/os-support/misc/Makefile.am b/xorg-server/hw/xfree86/os-support/misc/Makefile.am index 4bd3fc3e1..db5e7cff0 100644 --- a/xorg-server/hw/xfree86/os-support/misc/Makefile.am +++ b/xorg-server/hw/xfree86/os-support/misc/Makefile.am @@ -1,12 +1,12 @@ - -noinst_LTLIBRARIES = libmisc.la - -libmisc_la_SOURCES = SlowBcopy.c - -#AM_LDFLAGS = -r - -INCLUDES = $(XORG_INCS) - -AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) - -EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS) +
+noinst_LTLIBRARIES = libmisc.la
+
+libmisc_la_SOURCES = SlowBcopy.c
+
+#AM_LDFLAGS = -r
+
+INCLUDES = $(XORG_INCS)
+
+AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
+
+EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS)
diff --git a/xorg-server/hw/xfree86/os-support/solaris/Makefile.am b/xorg-server/hw/xfree86/os-support/solaris/Makefile.am index 5163f4423..9f358a6ea 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/Makefile.am +++ b/xorg-server/hw/xfree86/os-support/solaris/Makefile.am @@ -1,37 +1,37 @@ -if SOLARIS_VT -VTSW_SRC = sun_VTsw.c -else -VTSW_SRC = $(srcdir)/../shared/VTsw_noop.c -endif - -if AGP -AGP_SRC = sun_agp.c -else -AGP_SRC = $(srcdir)/../shared/agp_noop.c -endif - -SOLARIS_INOUT_SRC = solaris-@SOLARIS_INOUT_ARCH@.S -DISTCLEANFILES = solaris-@SOLARIS_INOUT_ARCH@.il - -solaris-@SOLARIS_INOUT_ARCH@.il: solaris-@SOLARIS_INOUT_ARCH@.S - $(CPP) -P -DINLINE_ASM $(srcdir)/solaris-@SOLARIS_INOUT_ARCH@.S > $@ - -noinst_LTLIBRARIES = libsolaris.la -libsolaris_la_SOURCES = sun_init.c \ - sun_vid.c sun_bell.c $(AGP_SRC) sun_apm.c \ - $(srcdir)/../shared/kmod_noop.c \ - $(srcdir)/../shared/posix_tty.c \ - $(srcdir)/../shared/sigio.c \ - $(srcdir)/../shared/vidmem.c \ - $(VTSW_SRC) -nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) - -sdk_HEADERS = -nodist_sdk_HEADERS = solaris-@SOLARIS_INOUT_ARCH@.il - -AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS) - -INCLUDES = $(XORG_INCS) - -EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S \ - apSolaris.shar sun_inout.s +if SOLARIS_VT
+VTSW_SRC = sun_VTsw.c
+else
+VTSW_SRC = $(srcdir)/../shared/VTsw_noop.c
+endif
+
+if AGP
+AGP_SRC = sun_agp.c
+else
+AGP_SRC = $(srcdir)/../shared/agp_noop.c
+endif
+
+SOLARIS_INOUT_SRC = solaris-@SOLARIS_INOUT_ARCH@.S
+DISTCLEANFILES = solaris-@SOLARIS_INOUT_ARCH@.il
+
+solaris-@SOLARIS_INOUT_ARCH@.il: solaris-@SOLARIS_INOUT_ARCH@.S
+ $(CPP) -P -DINLINE_ASM $(srcdir)/solaris-@SOLARIS_INOUT_ARCH@.S > $@
+
+noinst_LTLIBRARIES = libsolaris.la
+libsolaris_la_SOURCES = sun_init.c \
+ sun_vid.c sun_bell.c $(AGP_SRC) sun_apm.c \
+ $(srcdir)/../shared/kmod_noop.c \
+ $(srcdir)/../shared/posix_tty.c \
+ $(srcdir)/../shared/sigio.c \
+ $(srcdir)/../shared/vidmem.c \
+ $(VTSW_SRC)
+nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC)
+
+sdk_HEADERS =
+nodist_sdk_HEADERS = solaris-@SOLARIS_INOUT_ARCH@.il
+
+AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS)
+
+INCLUDES = $(XORG_INCS)
+
+EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S \
+ apSolaris.shar sun_inout.s
diff --git a/xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar b/xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar index a3548f7b4..68f44029e 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar +++ b/xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar @@ -1,806 +1,806 @@ -#!/bin/sh -# -# This is a shell archive. Save it in a file, remove anything before -# this line, and then unpack it by entering "sh file". Note, it may -# create directories; files and directories will be owned by you and -# have default permissions. -# Made on Sun Jun 25 20:24:59 CEST 2006 by Martin Bochnig at martux.org -# -# This archive contains: -# -# ./aperture -# -# ./aperture/Makefile -# ./aperture/Makefile.amd64 -# ./aperture/Makefile.sparcv9 -# ./aperture/README -# ./aperture/aperture.c -# ./aperture/aperture.conf -# ./aperture/devlink.tab -# -echo c - ./aperture -mkdir -p ./aperture > /dev/null 2>&1 -# -echo x - ./aperture/Makefile -sed 's/^X//' >./aperture/Makefile << 'END-of-./aperture/Makefile' -X# -X# File: makefile for aperture Framebuffer Driver -X# Author: Doug Anson (danson@lgc.com) -X# Date: 2/15/94 -X# Modified: David Holland (davidh@use.com) -X# Date: 2/23/94 -X# - Changed name, and debugging structure -X# Modified: Marc Aurele La France (tsi@xfree86.org) -X# Date: 2001.06.08 -X# - SPARC support, cleanup and turf aptest. -X# -X# >>NOTE<< Have a look at Makefile.sparcv9 for specifics. -X# -X# Modified: Martin Bochnig (martin@martux.org) -X# Date: 2006.06.24 -X# - Slightly modified to also build on Solaris 10 and 11. -X# - amd64 64 bit kernel support -X# - cosmetical changes to also support sun4v, not only sun4u -X# -X# >>NOTE<< Have a look at Makefile.amd64 for amd64 specifics. -X# -X# GNU gcc compiler -XCC=gcc -XCFLGS=-fno-builtin -Wall -O3 -X -X# -X# SUNWspro compiler -X#CC=/opt/SUNWspro/bin/cc -X#CFLGS=-Xa -xnolib -xO3 -X -X# -X# Debug error reporting -X#DEBUG_FLG= -X#DEBUG_FLG=-DAPERTURE_DEBUG -X -X# -X# Files and object declarations -XKERNEL_FLGS=-D_KERNEL -DSUNDDI -XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG) -XCFILES= aperture.c -XOBJS= aperture.o -XDRIVER= aperture -X -X# -X# Make rules -Xall: $(DRIVER) -X -X$(DRIVER): $(OBJS) -X @if [ -f "Makefile.`isainfo -k`" ]; then \ -X make -f Makefile.`isainfo -k` $(DRIVER); \ -X else \ -X rm -f $(DRIVER); \ -X ld -r -o $(DRIVER) $(OBJS); \ -X fi -X -Xinstall: $(DRIVER) -X @if [ -f "Makefile.`isainfo -k`" ]; then \ -X make -f Makefile.`isainfo -k` install; \ -X else \ -X cp aperture.conf /kernel/drv; \ -X cp $(DRIVER) /kernel/drv; \ -X fi -X -Xadd_drv: -X @if [ -f "Makefile.`isainfo -k`" ]; then \ -X make -f Makefile.`isainfo -k` add_drv; \ -X else \ -X add_drv aperture; \ -X fi -X -Xclean: -X rm -f *% *.BAK $(OBJS) $(DRIVER) core -X -X.SUFFIXES: .i -X -X.c.i: -X $(CC) -E $(CFLAGS) $*.c > $@ -X -X.c.o: -X @if [ -f "Makefile.`isainfo -k`" ]; then \ -X make -f Makefile.`isainfo -k` $@; \ -X else \ -X rm -f $@; \ -X $(CC) -c $(CFLAGS) $*.c -o $@; \ -X fi -END-of-./aperture/Makefile -echo x - ./aperture/Makefile.amd64 -sed 's/^X//' >./aperture/Makefile.amd64 << 'END-of-./aperture/Makefile.amd64' -X# -X# File: Makefile for aperture Framebuffer Driver -X# Author: Doug Anson (danson@lgc.com) -X# Date: 2/15/94 -X# Modified: David Holland (davidh@use.com) -X# Date: 2/23/94 -X# - Changed name, and debugging structure -X# Modified: Marc Aurele La France (tsi@xfree86.org) -X# Date: 2001.06.08 -X# - SPARC support, cleanup and turf aptest. -X# Modified: Martin Bochnig (martin@martux.org) -X# - amd64 64 bit kernel support, cosmetics and also -X# supporting sun4v (and arbitrary sparcv9) platforms -X# as well as SunOS 5.10 or higher now -X# - Changed name -X# -X -X# -X# GNU gcc compiler, version 3.2 or later -X# -XCC=gcc -XCFLGS=-fno-builtin -Wall -O3 -m64 -mcmodel=kernel -X -X# -X# SUNWspro compiler (untested, might not properly work for amd64 here) -X#CC=/opt/SUNWspro/bin/cc -X#CFLGS=-Xa -xarch=v9 -xnolib -xO3 -X -X# -X# Debug error reporting -X#DEBUG_FLG= -X#DEBUG_FLG=-DAPERTURE_DEBUG -X -X# -X# Files and object declarations -XKERNEL_FLGS=-D_KERNEL -DSUNDDI -XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG) -XCFILES= aperture.c -XOBJS= aperture.o -XDRIVER= aperture -X -X# -X# Make rules -Xall: $(DRIVER) -X -X$(DRIVER): $(OBJS) -X rm -f $(DRIVER) -X ld -r -o $(DRIVER) $(OBJS) -X -Xinstall: $(DRIVER) -X cp aperture.conf /kernel/drv -X cp $(DRIVER) /kernel/drv/amd64 -X -Xadd_drv: -X add_drv aperture -X -Xclean: -X rm -f *% *.BAK $(OBJS) $(DRIVER) core -X -X.SUFFIXES: .i -X -X.c.i: -X $(CC) -E $(CFLAGS) $*.c > $@ -END-of-./aperture/Makefile.amd64 -echo x - ./aperture/Makefile.sparcv9 -sed 's/^X//' >./aperture/Makefile.sparcv9 << 'END-of-./aperture/Makefile.sparcv9' -X# -X# File: makefile for aperture Framebuffer Driver -X# Author: Doug Anson (danson@lgc.com) -X# Date: 2/15/94 -X# Modified: David Holland (davidh@use.com) -X# Date: 2/23/94 -X# - Changed name, and debugging structure -X# Modified: Marc Aurele La France (tsi@xfree86.org) -X# Date: 2001.06.08 -X# - SPARC support, cleanup and turf aptest. -X# Modified: Martin Bochnig (martin@martux.org) -X# Date: 2006.06.24 -X# - Changed name for generic sparcv9 support -X# - updated to better work with Solaris 10 and 11 -X# -X -X# -X# GNU gcc compiler, version 3.2 or later -X# -XCC=gcc -XCFLGS=-fno-builtin -Wall -O3 -m64 -X -X# -X# SUNWspro compiler -X#CC=/opt/SUNWspro/bin/cc -X#CFLGS=-Xa -xarch=v9 -xnolib -xO3 -X -X# -X# Debug error reporting -X#DEBUG_FLG= -X#DEBUG_FLG=-DAPERTURE_DEBUG -X -X# -X# Files and object declarations -XKERNEL_FLGS=-D_KERNEL -DSUNDDI -XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG) -XCFILES= aperture.c -XOBJS= aperture.o -XDRIVER= aperture -X -X# -X# Make rules -Xall: $(DRIVER) -X -X$(DRIVER): $(OBJS) -X rm -f $(DRIVER) -X ld -r -o $(DRIVER) $(OBJS) -X -Xinstall: $(DRIVER) -X cp aperture.conf /kernel/drv -X cp $(DRIVER) /kernel/drv/sparcv9 -X -Xadd_drv: -X add_drv aperture -X -Xclean: -X rm -f *% *.BAK $(OBJS) $(DRIVER) core -X -X.SUFFIXES: .i -X -X.c.i: -X $(CC) -E $(CFLAGS) $*.c > $@ -END-of-./aperture/Makefile.sparcv9 -echo x - ./aperture/README -sed 's/^X//' >./aperture/README << 'END-of-./aperture/README' -XFramebuffer aperture driver. -X -XThis driver was written to provide a device that, unlike /dev/mem, allows -Xmmap()'ing of ranges beyond installed memory. -X -XThe original x86-based version of this driver was the collaborative work of -XDoug Anson (danson@lgc.com), and David Holland (davidh@use.com). It has since -Xbeen rewritten to also work on sparc machines and - later on - also on sparcv9 -Xand recently amd64 64 bit kernels. -XIt flawlessly compiles and installs on Solaris 10 and 11 now. -X -X -XInstallation instructions: -X -X1) Check the Makefile, for appropriate CC, and CFLAGS definitions. Compiling -X with APERTURE_DEBUG defined means the driver will generate reams of -X debugging output. You'll probably want to leave this off... -X -X2) Type 'make' (or 'gmake'). Both the driver and test program should compile -X without any problems. No warning messages should be generated. -X -X3) Become 'root'. -X -X4) Type 'make install' and 'make add_drv'. The screen should look something -X like this: -X -X # make install -X cp aperture aperture.conf /kernel/drv -X # make add_drv -X add_drv aperture -X -X On a sparcv9 machine this will mention the /kernel/drv/sparcv9 directory -X instead of /kernel/drv. Similarily /kernel/drv/amd64 should be used on amd64. -X -X This installs the driver to the system. -X -X5) While as root modify the file /etc/devlink.tab, adding these lines: -X -X# The following entry is for the framebuffer driver -Xtype=ddi_pseudo;name=aperture fbs/\M0 -X -X Add that line exactly as shown. You may also simply add the -X contents of the devlink.tab file supplied to /etc/devlink.tab. -X It contains the lines as well. (Yes, that is a tab between -X aperture and fbs, not spaces - very important) -X -X6) Perform a reconfiguration boot of the system. -X -X # touch /reconfigure -X # init 6 -X -XBug reports, questions, suggestions, etc can be sent to xfree86@xfree86.org. -END-of-./aperture/README -echo x - ./aperture/aperture.c -sed 's/^X//' >./aperture/aperture.c << 'END-of-./aperture/aperture.c' -X/* -X * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved. -X * -X * Permission is hereby granted, free of charge, to any person obtaining a copy -X * of this software and associated documentation files (the "Software"), to -X * deal in the Software without restriction, including without limitation the -X * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -X * sell copies of the Software, and to permit persons to whom the Software is -X * furnished to do so, subject to the following conditions: -X * -X * The above copyright notice and this permission notice shall be included in -X * all copies or substantial portions of the Software. -X * -X * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -X * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -X * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -X * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -X * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -X * -X * Except as contained in this notice, the name of the XFree86 Project shall -X * not be used in advertising or otherwise to promote the sale, use or other -X * dealings in this Software without prior written authorization from the -X * XFree86 Project. -X */ -X -X/* -X * Aperture driver for Solaris. -X */ -X -X/* -X * Modified: Martin Bochnig (martin@martux.org) -X * Log: Commented out obsolete kernel interfaces DDI_IDENTIFIED and DDI_NOT_IDENTIFIED -X * not supported by SunOS 5.10 or higher anymore, -X * see http://docs.sun.com/app/docs/doc/819-2255/6n4ibnffr?a=view -X */ -X -X#include <sys/conf.h> -X#include <sys/ddi.h> -X#include <sys/modctl.h> -X#include <sys/open.h> -X#include <sys/stat.h> -X#include <sys/sunddi.h> -X -X#define DEV_IDENT "aperture" -X#define DEV_BANNER "XFree86 aperture driver" -X -X#ifndef D_64BIT -X#define D_64BIT 0 -X#endif -X -X#ifndef NULL -X#define NULL ((void *)0) -X#endif -X -X/* -X * open(9E) -X */ -X/*ARGSUSED*/ -Xstatic int -Xaperture_open -X( -X#ifdef __STDC__ -X dev_t *devp, -X int flag, -X int typ, -X struct cred *cred -X#endif -X) -X#ifndef __STDC__ -X dev_t *devp; -X int flag; -X int typ; -X struct cred *cred; -X#endif -X{ -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering open()\n"); -X -X#endif -X -X if ((typ != OTYP_CHR) || (getminor(*devp))) -X error = EINVAL; -X else -X error = 0; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving open() = %d\n", error); -X -X#endif -X -X return error; -X} -X -X/* -X * mmap(9E) -X */ -X/*ARGSUSED*/ -Xstatic int -Xaperture_mmap -X( -X#ifdef __STDC__ -X dev_t dev, -X off_t off, -X int prot -X#endif -X) -X#ifndef __STDC__ -X dev_t dev; -X off_t off; -X int prot; -X#endif -X{ -X pfn_t pf; -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering mmap(0x%016lx)\n", off); -X -X#endif -X -X pf = btop((unsigned long)off); -X -X /* Deal with mmap(9E) interface limits */ -X error = (int)pf; -X if ((error < 0) || (pf != (pfn_t)error)) -X error = -1; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving mmap() = 0x%08lx", error); -X -X#endif -X -X return error; -X} -X -Xstatic struct cb_ops aperture_cb_ops = -X{ -X aperture_open, /* open */ -X nulldev, /* close */ -X nodev, /* strategy */ -X nodev, /* print */ -X nodev, /* dump */ -X nodev, /* read */ -X nodev, /* write */ -X nodev, /* ioctl */ -X nodev, /* devmap */ -X aperture_mmap, /* mmap */ -X ddi_segmap, /* segmap */ -X nochpoll, /* poll */ -X ddi_prop_op, /* cb_prop_op */ -X 0, /* streamtab */ -X D_NEW | D_MP | D_64BIT /* Driver compatibility flag */ -X}; -X -X -Xstatic dev_info_t *aperture_dip; /* private copy of devinfo pointer */ -X -X/* -X * getinfo(9E) -X */ -X/*ARGSUSED*/ -Xstatic int -Xaperture_getinfo -X( -X#ifdef __STDC__ -X dev_info_t *dip, -X ddi_info_cmd_t infocmd, -X void *arg, -X void **result -X#endif -X) -X#ifndef __STDC__ -X dev_info_t *dip; -X ddi_info_cmd_t infocmd; -X void *arg; -X void **result; -X#endif -X{ -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering getinfo()\n"); -X -X#endif -X -X switch (infocmd) { -X case DDI_INFO_DEVT2DEVINFO: -X *result = aperture_dip; -X error = DDI_SUCCESS; -X break; -X case DDI_INFO_DEVT2INSTANCE: -X *result = NULL; -X error = DDI_SUCCESS; -X break; -X default: -X error = DDI_FAILURE; -X } -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving getinfo() = %d\n", error); -X -X#endif -X -X return error; -X} -X -X/* -X * identify(9E) -X */ -X/*ARGSUSED*/ -Xstatic int -Xaperture_identify -X( -X#ifdef __STDC__ -X dev_info_t *dip -X#endif -X) -X#ifndef __STDC__ -X dev_info_t *dip; -X#endif -X{ -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering identify()\n"); -X -X#endif -X -X if (strcmp(ddi_get_name(dip), DEV_IDENT)) -X error = 1 /* DDI_NOT_IDENTIFIED obsolete since SunOS 5.10 */ ; -X else -X error = 2 /* DDI_IDENTIFIED obsolete since SunOS 5.10 */ ; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving identify() = %d\n", error); -X -X#endif -X -X return error; -X} -X -X/* -X * attach(9E) -X */ -X/*ARGSUSED*/ -Xstatic int -Xaperture_attach -X( -X#ifdef __STDC__ -X dev_info_t *dip, -X ddi_attach_cmd_t cmd -X#endif -X) -X#ifndef __STDC__ -X dev_info_t *dip; -X ddi_attach_cmd_t cmd; -X#endif -X{ -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering attach()\n"); -X -X#endif -X -X if (cmd != DDI_ATTACH) -X { -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": not attach(, DDI_ATTACH)\n"); -X -X#endif -X -X error = DDI_FAILURE; -X } -X else -X { -X error = ddi_create_minor_node(dip, ddi_get_name(dip), S_IFCHR, -X (minor_t)ddi_get_instance(dip), -X NULL, 0 /* NODESPECIFIC_DEV obsolete since SunOS 5.10 */ ); -X -X if (error == DDI_SUCCESS) -X { -X aperture_dip = dip; -X ddi_report_dev(dip); -X } -X } -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving attach() = %d\n", error); -X -X#endif -X -X return error; -X} -X -X/* -X * detach(9E) -X */ -Xstatic int -Xaperture_detach -X( -X#ifdef __STDC__ -X dev_info_t *dip, -X ddi_detach_cmd_t cmd -X#endif -X) -X#ifndef __STDC__ -X dev_info_t *dip; -X ddi_detach_cmd_t cmd; -X#endif -X{ -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering detach()\n"); -X -X#endif -X -X if (cmd != DDI_DETACH) -X { -X error = DDI_FAILURE; -X } -X else -X { -X ddi_remove_minor_node(dip, NULL); -X aperture_dip = NULL; -X error = DDI_SUCCESS; -X } -X -X#if APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving detach() = %d\n", error); -X -X#endif -X -X return error; -X} -X -X -Xstatic struct dev_ops aperture_ops = -X{ -X DEVO_REV, /* revision */ -X 0, /* refcnt */ -X aperture_getinfo, /* getinfo */ -X aperture_identify, /* identify */ -X nulldev, /* probe */ -X aperture_attach, /* attach */ -X aperture_detach, /* detach */ -X nodev, /* reset */ -X &aperture_cb_ops, /* driver operations */ -X NULL /* bus operations */ -X}; -X -X -Xstatic struct modldrv modldrv = -X{ -X &mod_driverops, /* mod_ops structure pointer */ -X DEV_BANNER, /* driver banner string */ -X &aperture_ops, /* dev_ops structure pointer */ -X}; -X -X -Xstatic struct modlinkage modlinkage = -X{ -X MODREV_1, /* module API revision */ -X { -X &modldrv, /* module driver structure pointer */ -X NULL /* list termination */ -X } -X}; -X -X -X/* -X * _init(9E) -X */ -Xint -X_init -X( -X#ifdef __STDC__ -X void -X#endif -X) -X{ -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering _init()\n"); -X -X#endif -X -X error = mod_install(&modlinkage); -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving _init() = %d\n", error); -X -X#endif -X -X return error; -X} -X -X/* -X * _info(9E) -X */ -Xint -X_info -X( -X#ifdef __STDC__ -X struct modinfo *modinfop -X#endif -X) -X#ifndef __STDC__ -X struct modinfo *modinfop; -X#endif -X{ -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering _info()\n"); -X -X#endif -X -X error = mod_info(&modlinkage, modinfop); -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving _info() = %d\n", error); -X -X#endif -X -X return error; -X} -X -X/* -X * _fini(9E) -X */ -Xint -X_fini -X( -X#ifdef __STDC__ -X void -X#endif -X) -X{ -X int error; -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": entering _fini()\n"); -X -X#endif -X -X error = mod_remove(&modlinkage); -X -X#ifdef APERTURE_DEBUG -X -X cmn_err(CE_CONT, DEV_IDENT ": leaving _fini() = %d\n", error); -X -X#endif -X -X return error; -X} -END-of-./aperture/aperture.c -echo x - ./aperture/aperture.conf -sed 's/^X//' >./aperture/aperture.conf << 'END-of-./aperture/aperture.conf' -X# -X# Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com -X# -X# File: aperture.conf -X# Author: Doug Anson (danson@lgc.com) -X# -X# Modified: David Holland (davidh@use.com) -X# Log: Change comments 02/23/94 -X# Change defaults/comments 09/25/94 -X# -X# Modified: Marc Aurele La France (tsi@xfree86.org) -X# Log: SPARC changes 2001.09 -X# -X# Purpose: This conf file is used by the aperture driver. -X# -Xname="aperture" parent="pseudo"; -END-of-./aperture/aperture.conf -echo x - ./aperture/devlink.tab -sed 's/^X//' >./aperture/devlink.tab << 'END-of-./aperture/devlink.tab' -X# The following entry is for the aperture driver -Xtype=ddi_pseudo;name=aperture fbs/\M0 -END-of-./aperture/devlink.tab -exit - +#!/bin/sh
+#
+# This is a shell archive. Save it in a file, remove anything before
+# this line, and then unpack it by entering "sh file". Note, it may
+# create directories; files and directories will be owned by you and
+# have default permissions.
+# Made on Sun Jun 25 20:24:59 CEST 2006 by Martin Bochnig at martux.org
+#
+# This archive contains:
+#
+# ./aperture
+#
+# ./aperture/Makefile
+# ./aperture/Makefile.amd64
+# ./aperture/Makefile.sparcv9
+# ./aperture/README
+# ./aperture/aperture.c
+# ./aperture/aperture.conf
+# ./aperture/devlink.tab
+#
+echo c - ./aperture
+mkdir -p ./aperture > /dev/null 2>&1
+#
+echo x - ./aperture/Makefile
+sed 's/^X//' >./aperture/Makefile << 'END-of-./aperture/Makefile'
+X#
+X# File: makefile for aperture Framebuffer Driver
+X# Author: Doug Anson (danson@lgc.com)
+X# Date: 2/15/94
+X# Modified: David Holland (davidh@use.com)
+X# Date: 2/23/94
+X# - Changed name, and debugging structure
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Date: 2001.06.08
+X# - SPARC support, cleanup and turf aptest.
+X#
+X# >>NOTE<< Have a look at Makefile.sparcv9 for specifics.
+X#
+X# Modified: Martin Bochnig (martin@martux.org)
+X# Date: 2006.06.24
+X# - Slightly modified to also build on Solaris 10 and 11.
+X# - amd64 64 bit kernel support
+X# - cosmetical changes to also support sun4v, not only sun4u
+X#
+X# >>NOTE<< Have a look at Makefile.amd64 for amd64 specifics.
+X#
+X# GNU gcc compiler
+XCC=gcc
+XCFLGS=-fno-builtin -Wall -O3
+X
+X#
+X# SUNWspro compiler
+X#CC=/opt/SUNWspro/bin/cc
+X#CFLGS=-Xa -xnolib -xO3
+X
+X#
+X# Debug error reporting
+X#DEBUG_FLG=
+X#DEBUG_FLG=-DAPERTURE_DEBUG
+X
+X#
+X# Files and object declarations
+XKERNEL_FLGS=-D_KERNEL -DSUNDDI
+XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
+XCFILES= aperture.c
+XOBJS= aperture.o
+XDRIVER= aperture
+X
+X#
+X# Make rules
+Xall: $(DRIVER)
+X
+X$(DRIVER): $(OBJS)
+X @if [ -f "Makefile.`isainfo -k`" ]; then \
+X make -f Makefile.`isainfo -k` $(DRIVER); \
+X else \
+X rm -f $(DRIVER); \
+X ld -r -o $(DRIVER) $(OBJS); \
+X fi
+X
+Xinstall: $(DRIVER)
+X @if [ -f "Makefile.`isainfo -k`" ]; then \
+X make -f Makefile.`isainfo -k` install; \
+X else \
+X cp aperture.conf /kernel/drv; \
+X cp $(DRIVER) /kernel/drv; \
+X fi
+X
+Xadd_drv:
+X @if [ -f "Makefile.`isainfo -k`" ]; then \
+X make -f Makefile.`isainfo -k` add_drv; \
+X else \
+X add_drv aperture; \
+X fi
+X
+Xclean:
+X rm -f *% *.BAK $(OBJS) $(DRIVER) core
+X
+X.SUFFIXES: .i
+X
+X.c.i:
+X $(CC) -E $(CFLAGS) $*.c > $@
+X
+X.c.o:
+X @if [ -f "Makefile.`isainfo -k`" ]; then \
+X make -f Makefile.`isainfo -k` $@; \
+X else \
+X rm -f $@; \
+X $(CC) -c $(CFLAGS) $*.c -o $@; \
+X fi
+END-of-./aperture/Makefile
+echo x - ./aperture/Makefile.amd64
+sed 's/^X//' >./aperture/Makefile.amd64 << 'END-of-./aperture/Makefile.amd64'
+X#
+X# File: Makefile for aperture Framebuffer Driver
+X# Author: Doug Anson (danson@lgc.com)
+X# Date: 2/15/94
+X# Modified: David Holland (davidh@use.com)
+X# Date: 2/23/94
+X# - Changed name, and debugging structure
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Date: 2001.06.08
+X# - SPARC support, cleanup and turf aptest.
+X# Modified: Martin Bochnig (martin@martux.org)
+X# - amd64 64 bit kernel support, cosmetics and also
+X# supporting sun4v (and arbitrary sparcv9) platforms
+X# as well as SunOS 5.10 or higher now
+X# - Changed name
+X#
+X
+X#
+X# GNU gcc compiler, version 3.2 or later
+X#
+XCC=gcc
+XCFLGS=-fno-builtin -Wall -O3 -m64 -mcmodel=kernel
+X
+X#
+X# SUNWspro compiler (untested, might not properly work for amd64 here)
+X#CC=/opt/SUNWspro/bin/cc
+X#CFLGS=-Xa -xarch=v9 -xnolib -xO3
+X
+X#
+X# Debug error reporting
+X#DEBUG_FLG=
+X#DEBUG_FLG=-DAPERTURE_DEBUG
+X
+X#
+X# Files and object declarations
+XKERNEL_FLGS=-D_KERNEL -DSUNDDI
+XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
+XCFILES= aperture.c
+XOBJS= aperture.o
+XDRIVER= aperture
+X
+X#
+X# Make rules
+Xall: $(DRIVER)
+X
+X$(DRIVER): $(OBJS)
+X rm -f $(DRIVER)
+X ld -r -o $(DRIVER) $(OBJS)
+X
+Xinstall: $(DRIVER)
+X cp aperture.conf /kernel/drv
+X cp $(DRIVER) /kernel/drv/amd64
+X
+Xadd_drv:
+X add_drv aperture
+X
+Xclean:
+X rm -f *% *.BAK $(OBJS) $(DRIVER) core
+X
+X.SUFFIXES: .i
+X
+X.c.i:
+X $(CC) -E $(CFLAGS) $*.c > $@
+END-of-./aperture/Makefile.amd64
+echo x - ./aperture/Makefile.sparcv9
+sed 's/^X//' >./aperture/Makefile.sparcv9 << 'END-of-./aperture/Makefile.sparcv9'
+X#
+X# File: makefile for aperture Framebuffer Driver
+X# Author: Doug Anson (danson@lgc.com)
+X# Date: 2/15/94
+X# Modified: David Holland (davidh@use.com)
+X# Date: 2/23/94
+X# - Changed name, and debugging structure
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Date: 2001.06.08
+X# - SPARC support, cleanup and turf aptest.
+X# Modified: Martin Bochnig (martin@martux.org)
+X# Date: 2006.06.24
+X# - Changed name for generic sparcv9 support
+X# - updated to better work with Solaris 10 and 11
+X#
+X
+X#
+X# GNU gcc compiler, version 3.2 or later
+X#
+XCC=gcc
+XCFLGS=-fno-builtin -Wall -O3 -m64
+X
+X#
+X# SUNWspro compiler
+X#CC=/opt/SUNWspro/bin/cc
+X#CFLGS=-Xa -xarch=v9 -xnolib -xO3
+X
+X#
+X# Debug error reporting
+X#DEBUG_FLG=
+X#DEBUG_FLG=-DAPERTURE_DEBUG
+X
+X#
+X# Files and object declarations
+XKERNEL_FLGS=-D_KERNEL -DSUNDDI
+XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
+XCFILES= aperture.c
+XOBJS= aperture.o
+XDRIVER= aperture
+X
+X#
+X# Make rules
+Xall: $(DRIVER)
+X
+X$(DRIVER): $(OBJS)
+X rm -f $(DRIVER)
+X ld -r -o $(DRIVER) $(OBJS)
+X
+Xinstall: $(DRIVER)
+X cp aperture.conf /kernel/drv
+X cp $(DRIVER) /kernel/drv/sparcv9
+X
+Xadd_drv:
+X add_drv aperture
+X
+Xclean:
+X rm -f *% *.BAK $(OBJS) $(DRIVER) core
+X
+X.SUFFIXES: .i
+X
+X.c.i:
+X $(CC) -E $(CFLAGS) $*.c > $@
+END-of-./aperture/Makefile.sparcv9
+echo x - ./aperture/README
+sed 's/^X//' >./aperture/README << 'END-of-./aperture/README'
+XFramebuffer aperture driver.
+X
+XThis driver was written to provide a device that, unlike /dev/mem, allows
+Xmmap()'ing of ranges beyond installed memory.
+X
+XThe original x86-based version of this driver was the collaborative work of
+XDoug Anson (danson@lgc.com), and David Holland (davidh@use.com). It has since
+Xbeen rewritten to also work on sparc machines and - later on - also on sparcv9
+Xand recently amd64 64 bit kernels.
+XIt flawlessly compiles and installs on Solaris 10 and 11 now.
+X
+X
+XInstallation instructions:
+X
+X1) Check the Makefile, for appropriate CC, and CFLAGS definitions. Compiling
+X with APERTURE_DEBUG defined means the driver will generate reams of
+X debugging output. You'll probably want to leave this off...
+X
+X2) Type 'make' (or 'gmake'). Both the driver and test program should compile
+X without any problems. No warning messages should be generated.
+X
+X3) Become 'root'.
+X
+X4) Type 'make install' and 'make add_drv'. The screen should look something
+X like this:
+X
+X # make install
+X cp aperture aperture.conf /kernel/drv
+X # make add_drv
+X add_drv aperture
+X
+X On a sparcv9 machine this will mention the /kernel/drv/sparcv9 directory
+X instead of /kernel/drv. Similarily /kernel/drv/amd64 should be used on amd64.
+X
+X This installs the driver to the system.
+X
+X5) While as root modify the file /etc/devlink.tab, adding these lines:
+X
+X# The following entry is for the framebuffer driver
+Xtype=ddi_pseudo;name=aperture fbs/\M0
+X
+X Add that line exactly as shown. You may also simply add the
+X contents of the devlink.tab file supplied to /etc/devlink.tab.
+X It contains the lines as well. (Yes, that is a tab between
+X aperture and fbs, not spaces - very important)
+X
+X6) Perform a reconfiguration boot of the system.
+X
+X # touch /reconfigure
+X # init 6
+X
+XBug reports, questions, suggestions, etc can be sent to xfree86@xfree86.org.
+END-of-./aperture/README
+echo x - ./aperture/aperture.c
+sed 's/^X//' >./aperture/aperture.c << 'END-of-./aperture/aperture.c'
+X/*
+X * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
+X *
+X * Permission is hereby granted, free of charge, to any person obtaining a copy
+X * of this software and associated documentation files (the "Software"), to
+X * deal in the Software without restriction, including without limitation the
+X * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+X * sell copies of the Software, and to permit persons to whom the Software is
+X * furnished to do so, subject to the following conditions:
+X *
+X * The above copyright notice and this permission notice shall be included in
+X * all copies or substantial portions of the Software.
+X *
+X * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+X * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+X * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+X * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+X * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+X * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+X *
+X * Except as contained in this notice, the name of the XFree86 Project shall
+X * not be used in advertising or otherwise to promote the sale, use or other
+X * dealings in this Software without prior written authorization from the
+X * XFree86 Project.
+X */
+X
+X/*
+X * Aperture driver for Solaris.
+X */
+X
+X/*
+X * Modified: Martin Bochnig (martin@martux.org)
+X * Log: Commented out obsolete kernel interfaces DDI_IDENTIFIED and DDI_NOT_IDENTIFIED
+X * not supported by SunOS 5.10 or higher anymore,
+X * see http://docs.sun.com/app/docs/doc/819-2255/6n4ibnffr?a=view
+X */
+X
+X#include <sys/conf.h>
+X#include <sys/ddi.h>
+X#include <sys/modctl.h>
+X#include <sys/open.h>
+X#include <sys/stat.h>
+X#include <sys/sunddi.h>
+X
+X#define DEV_IDENT "aperture"
+X#define DEV_BANNER "XFree86 aperture driver"
+X
+X#ifndef D_64BIT
+X#define D_64BIT 0
+X#endif
+X
+X#ifndef NULL
+X#define NULL ((void *)0)
+X#endif
+X
+X/*
+X * open(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_open
+X(
+X#ifdef __STDC__
+X dev_t *devp,
+X int flag,
+X int typ,
+X struct cred *cred
+X#endif
+X)
+X#ifndef __STDC__
+X dev_t *devp;
+X int flag;
+X int typ;
+X struct cred *cred;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering open()\n");
+X
+X#endif
+X
+X if ((typ != OTYP_CHR) || (getminor(*devp)))
+X error = EINVAL;
+X else
+X error = 0;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving open() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * mmap(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_mmap
+X(
+X#ifdef __STDC__
+X dev_t dev,
+X off_t off,
+X int prot
+X#endif
+X)
+X#ifndef __STDC__
+X dev_t dev;
+X off_t off;
+X int prot;
+X#endif
+X{
+X pfn_t pf;
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering mmap(0x%016lx)\n", off);
+X
+X#endif
+X
+X pf = btop((unsigned long)off);
+X
+X /* Deal with mmap(9E) interface limits */
+X error = (int)pf;
+X if ((error < 0) || (pf != (pfn_t)error))
+X error = -1;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving mmap() = 0x%08lx", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+Xstatic struct cb_ops aperture_cb_ops =
+X{
+X aperture_open, /* open */
+X nulldev, /* close */
+X nodev, /* strategy */
+X nodev, /* print */
+X nodev, /* dump */
+X nodev, /* read */
+X nodev, /* write */
+X nodev, /* ioctl */
+X nodev, /* devmap */
+X aperture_mmap, /* mmap */
+X ddi_segmap, /* segmap */
+X nochpoll, /* poll */
+X ddi_prop_op, /* cb_prop_op */
+X 0, /* streamtab */
+X D_NEW | D_MP | D_64BIT /* Driver compatibility flag */
+X};
+X
+X
+Xstatic dev_info_t *aperture_dip; /* private copy of devinfo pointer */
+X
+X/*
+X * getinfo(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_getinfo
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_info_cmd_t infocmd,
+X void *arg,
+X void **result
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_info_cmd_t infocmd;
+X void *arg;
+X void **result;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering getinfo()\n");
+X
+X#endif
+X
+X switch (infocmd) {
+X case DDI_INFO_DEVT2DEVINFO:
+X *result = aperture_dip;
+X error = DDI_SUCCESS;
+X break;
+X case DDI_INFO_DEVT2INSTANCE:
+X *result = NULL;
+X error = DDI_SUCCESS;
+X break;
+X default:
+X error = DDI_FAILURE;
+X }
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving getinfo() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * identify(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_identify
+X(
+X#ifdef __STDC__
+X dev_info_t *dip
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering identify()\n");
+X
+X#endif
+X
+X if (strcmp(ddi_get_name(dip), DEV_IDENT))
+X error = 1 /* DDI_NOT_IDENTIFIED obsolete since SunOS 5.10 */ ;
+X else
+X error = 2 /* DDI_IDENTIFIED obsolete since SunOS 5.10 */ ;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving identify() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * attach(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_attach
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_attach_cmd_t cmd
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_attach_cmd_t cmd;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering attach()\n");
+X
+X#endif
+X
+X if (cmd != DDI_ATTACH)
+X {
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": not attach(, DDI_ATTACH)\n");
+X
+X#endif
+X
+X error = DDI_FAILURE;
+X }
+X else
+X {
+X error = ddi_create_minor_node(dip, ddi_get_name(dip), S_IFCHR,
+X (minor_t)ddi_get_instance(dip),
+X NULL, 0 /* NODESPECIFIC_DEV obsolete since SunOS 5.10 */ );
+X
+X if (error == DDI_SUCCESS)
+X {
+X aperture_dip = dip;
+X ddi_report_dev(dip);
+X }
+X }
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving attach() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * detach(9E)
+X */
+Xstatic int
+Xaperture_detach
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_detach_cmd_t cmd
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_detach_cmd_t cmd;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering detach()\n");
+X
+X#endif
+X
+X if (cmd != DDI_DETACH)
+X {
+X error = DDI_FAILURE;
+X }
+X else
+X {
+X ddi_remove_minor_node(dip, NULL);
+X aperture_dip = NULL;
+X error = DDI_SUCCESS;
+X }
+X
+X#if APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving detach() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X
+Xstatic struct dev_ops aperture_ops =
+X{
+X DEVO_REV, /* revision */
+X 0, /* refcnt */
+X aperture_getinfo, /* getinfo */
+X aperture_identify, /* identify */
+X nulldev, /* probe */
+X aperture_attach, /* attach */
+X aperture_detach, /* detach */
+X nodev, /* reset */
+X &aperture_cb_ops, /* driver operations */
+X NULL /* bus operations */
+X};
+X
+X
+Xstatic struct modldrv modldrv =
+X{
+X &mod_driverops, /* mod_ops structure pointer */
+X DEV_BANNER, /* driver banner string */
+X &aperture_ops, /* dev_ops structure pointer */
+X};
+X
+X
+Xstatic struct modlinkage modlinkage =
+X{
+X MODREV_1, /* module API revision */
+X {
+X &modldrv, /* module driver structure pointer */
+X NULL /* list termination */
+X }
+X};
+X
+X
+X/*
+X * _init(9E)
+X */
+Xint
+X_init
+X(
+X#ifdef __STDC__
+X void
+X#endif
+X)
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _init()\n");
+X
+X#endif
+X
+X error = mod_install(&modlinkage);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _init() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * _info(9E)
+X */
+Xint
+X_info
+X(
+X#ifdef __STDC__
+X struct modinfo *modinfop
+X#endif
+X)
+X#ifndef __STDC__
+X struct modinfo *modinfop;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _info()\n");
+X
+X#endif
+X
+X error = mod_info(&modlinkage, modinfop);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _info() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * _fini(9E)
+X */
+Xint
+X_fini
+X(
+X#ifdef __STDC__
+X void
+X#endif
+X)
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _fini()\n");
+X
+X#endif
+X
+X error = mod_remove(&modlinkage);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _fini() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+END-of-./aperture/aperture.c
+echo x - ./aperture/aperture.conf
+sed 's/^X//' >./aperture/aperture.conf << 'END-of-./aperture/aperture.conf'
+X#
+X# Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
+X#
+X# File: aperture.conf
+X# Author: Doug Anson (danson@lgc.com)
+X#
+X# Modified: David Holland (davidh@use.com)
+X# Log: Change comments 02/23/94
+X# Change defaults/comments 09/25/94
+X#
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Log: SPARC changes 2001.09
+X#
+X# Purpose: This conf file is used by the aperture driver.
+X#
+Xname="aperture" parent="pseudo";
+END-of-./aperture/aperture.conf
+echo x - ./aperture/devlink.tab
+sed 's/^X//' >./aperture/devlink.tab << 'END-of-./aperture/devlink.tab'
+X# The following entry is for the aperture driver
+Xtype=ddi_pseudo;name=aperture fbs/\M0
+END-of-./aperture/devlink.tab
+exit
+
diff --git a/xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S b/xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S index a371f9b66..4cc0642dd 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S +++ b/xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S @@ -1,67 +1,67 @@ -/ Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
-/
-/ Permission is hereby granted, free of charge, to any person obtaining a
-/ copy of this software and associated documentation files (the "Software"),
-/ to deal in the Software without restriction, including without limitation
-/ the rights to use, copy, modify, merge, publish, distribute, sublicense,
-/ and/or sell copies of the Software, and to permit persons to whom the
-/ Software is furnished to do so, subject to the following conditions:
-/
-/ The above copyright notice and this permission notice (including the next
-/ paragraph) shall be included in all copies or substantial portions of the
-/ Software.
-/
-/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-/ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-/ DEALINGS IN THE SOFTWARE.
-
-#ifdef INLINE_ASM
-#define FUNCTION_START(f,n) .inline f,n
-#define FUNCTION_END(f) .end
-#else
-#define _ASM
-#include <sys/asm_linkage.h>
-#define FUNCTION_START(f,n) ENTRY(f)
-#define FUNCTION_END(f) ret; SET_SIZE(f)
-#endif
-
- FUNCTION_START(inb,4)
- movq %rdi, %rdx
- xorq %rax, %rax
- inb (%dx)
- FUNCTION_END(inb)
-
- FUNCTION_START(inw,4)
- movq %rdi, %rdx
- xorq %rax, %rax
- inw (%dx)
- FUNCTION_END(inw)
-
- FUNCTION_START(inl,4)
- movq %rdi, %rdx
- xorq %rax, %rax
- inl (%dx)
- FUNCTION_END(inl)
-
- FUNCTION_START(outb,8)
- movq %rdi, %rdx
- movq %rsi, %rax
- outb (%dx)
- FUNCTION_END(outb)
-
- FUNCTION_START(outw,8)
- movq %rdi, %rdx
- movq %rsi, %rax
- outw (%dx)
- FUNCTION_END(outw)
-
- FUNCTION_START(outl,8)
- movq %rdi, %rdx
- movq %rsi, %rax
- outl (%dx)
- FUNCTION_END(outl)
-
+/ Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +/ +/ Permission is hereby granted, free of charge, to any person obtaining a +/ copy of this software and associated documentation files (the "Software"), +/ to deal in the Software without restriction, including without limitation +/ the rights to use, copy, modify, merge, publish, distribute, sublicense, +/ and/or sell copies of the Software, and to permit persons to whom the +/ Software is furnished to do so, subject to the following conditions: +/ +/ The above copyright notice and this permission notice (including the next +/ paragraph) shall be included in all copies or substantial portions of the +/ Software. +/ +/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +/ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +/ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +/ DEALINGS IN THE SOFTWARE. + +#ifdef INLINE_ASM +#define FUNCTION_START(f,n) .inline f,n +#define FUNCTION_END(f) .end +#else +#define _ASM +#include <sys/asm_linkage.h> +#define FUNCTION_START(f,n) ENTRY(f) +#define FUNCTION_END(f) ret; SET_SIZE(f) +#endif + + FUNCTION_START(inb,4) + movq %rdi, %rdx + xorq %rax, %rax + inb (%dx) + FUNCTION_END(inb) + + FUNCTION_START(inw,4) + movq %rdi, %rdx + xorq %rax, %rax + inw (%dx) + FUNCTION_END(inw) + + FUNCTION_START(inl,4) + movq %rdi, %rdx + xorq %rax, %rax + inl (%dx) + FUNCTION_END(inl) + + FUNCTION_START(outb,8) + movq %rdi, %rdx + movq %rsi, %rax + outb (%dx) + FUNCTION_END(outb) + + FUNCTION_START(outw,8) + movq %rdi, %rdx + movq %rsi, %rax + outw (%dx) + FUNCTION_END(outw) + + FUNCTION_START(outl,8) + movq %rdi, %rdx + movq %rsi, %rax + outl (%dx) + FUNCTION_END(outl) + diff --git a/xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S b/xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S index 0068b06e4..74d787d31 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S +++ b/xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S @@ -1,67 +1,67 @@ -/ Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
-/
-/ Permission is hereby granted, free of charge, to any person obtaining a
-/ copy of this software and associated documentation files (the "Software"),
-/ to deal in the Software without restriction, including without limitation
-/ the rights to use, copy, modify, merge, publish, distribute, sublicense,
-/ and/or sell copies of the Software, and to permit persons to whom the
-/ Software is furnished to do so, subject to the following conditions:
-/
-/ The above copyright notice and this permission notice (including the next
-/ paragraph) shall be included in all copies or substantial portions of the
-/ Software.
-/
-/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-/ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-/ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-/ DEALINGS IN THE SOFTWARE.
-
-#ifdef INLINE_ASM
-#define FUNCTION_START(f,n) .inline f,n
-#define FUNCTION_END(f) .end
-#else
-#define _ASM
-#include <sys/asm_linkage.h>
-#define FUNCTION_START(f,n) ENTRY(f)
-#define FUNCTION_END(f) ret; SET_SIZE(f)
-#endif
-
- FUNCTION_START(inb,4)
- movl (%esp), %edx
- xorl %eax, %eax
- inb (%dx)
- FUNCTION_END(inb)
-
- FUNCTION_START(inw,4)
- movl (%esp), %edx
- xorl %eax, %eax
- inw (%dx)
- FUNCTION_END(inw)
-
- FUNCTION_START(inl,4)
- movl (%esp), %edx
- xorl %eax, %eax
- inl (%dx)
- FUNCTION_END(inl)
-
- FUNCTION_START(outb,8)
- movl (%esp), %edx
- movl 4(%esp), %eax
- outb (%dx)
- FUNCTION_END(outb)
-
- FUNCTION_START(outw,8)
- movl (%esp), %edx
- movl 4(%esp), %eax
- outw (%dx)
- FUNCTION_END(outw)
-
- FUNCTION_START(outl,8)
- movl (%esp), %edx
- movl 4(%esp), %eax
- outl (%dx)
- FUNCTION_END(outl)
-
+/ Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +/ +/ Permission is hereby granted, free of charge, to any person obtaining a +/ copy of this software and associated documentation files (the "Software"), +/ to deal in the Software without restriction, including without limitation +/ the rights to use, copy, modify, merge, publish, distribute, sublicense, +/ and/or sell copies of the Software, and to permit persons to whom the +/ Software is furnished to do so, subject to the following conditions: +/ +/ The above copyright notice and this permission notice (including the next +/ paragraph) shall be included in all copies or substantial portions of the +/ Software. +/ +/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +/ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +/ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +/ DEALINGS IN THE SOFTWARE. + +#ifdef INLINE_ASM +#define FUNCTION_START(f,n) .inline f,n +#define FUNCTION_END(f) .end +#else +#define _ASM +#include <sys/asm_linkage.h> +#define FUNCTION_START(f,n) ENTRY(f) +#define FUNCTION_END(f) ret; SET_SIZE(f) +#endif + + FUNCTION_START(inb,4) + movl (%esp), %edx + xorl %eax, %eax + inb (%dx) + FUNCTION_END(inb) + + FUNCTION_START(inw,4) + movl (%esp), %edx + xorl %eax, %eax + inw (%dx) + FUNCTION_END(inw) + + FUNCTION_START(inl,4) + movl (%esp), %edx + xorl %eax, %eax + inl (%dx) + FUNCTION_END(inl) + + FUNCTION_START(outb,8) + movl (%esp), %edx + movl 4(%esp), %eax + outb (%dx) + FUNCTION_END(outb) + + FUNCTION_START(outw,8) + movl (%esp), %edx + movl 4(%esp), %eax + outw (%dx) + FUNCTION_END(outw) + + FUNCTION_START(outl,8) + movl (%esp), %edx + movl 4(%esp), %eax + outl (%dx) + FUNCTION_END(outl) + diff --git a/xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S b/xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S index 3bb8d241c..0ecafb352 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S +++ b/xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S @@ -1,138 +1,138 @@ -/* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef INLINE_ASM
-#define FUNCTION_START(f,n) .inline f,n
-#define FUNCTION_END(f) .end
-#else
-#define _ASM
-#include <sys/asm_linkage.h>
-#define FUNCTION_START(f,n) ENTRY(f)
-#define FUNCTION_END(f) retl; nop; SET_SIZE(f)
-#endif
-
-/* Converted from common/compiler.h gcc inline format to Sun cc inline
- * format by Kenjiro Tsuji
- *
- * The value 0x88 means ASI_PRIMARY_LITTLE.
- * The store or load to/from the address space will be done
- * as little-endian. In the original xrog code, the value
- * is defined as the macro ASI_PL.
- *
- * In the original xorg code, "membar #StoreStore|#StoreLoad"
- * is directly implemented as an instruction "0x8143e00a".
- *
- */
-
- FUNCTION_START(outb, 0)
- stba %o1, [%o0] 0x88
- membar #StoreStore|#StoreLoad
- FUNCTION_END(outb)
-
- FUNCTION_START(outw, 0)
- stha %o1, [%o0] 0x88
- membar #StoreStore|#StoreLoad
- FUNCTION_END(outw)
-
- FUNCTION_START(outl, 0)
- sta %o1, [%o0] 0x88
- membar #StoreStore|#StoreLoad
- FUNCTION_END(outl)
-
- FUNCTION_START(inb, 0)
- lduba [%o0] 0x88, %o0
- FUNCTION_END(inb)
-
- FUNCTION_START(inw, 0)
- lduha [%o0] 0x88, %o0
- FUNCTION_END(inw)
-
- FUNCTION_START(inl, 0)
- lda [%o0] 0x88, %o0
- FUNCTION_END(inl)
-
- FUNCTION_START(xf86ReadMmio8, 0)
- lduba [%o0 + %o1] 0x88, %o0
- FUNCTION_END(xf86ReadMmio8)
-
- FUNCTION_START(xf86ReadMmio16Be, 0)
- lduh [%o0 + %o1], %o0
- FUNCTION_END(xf86ReadMmio16Be)
-
- FUNCTION_START(xf86ReadMmio16Le, 0)
- lduha [%o0 + %o1] 0x88, %o0
- FUNCTION_END(xf86ReadMmio16Le)
-
- FUNCTION_START(xf86ReadMmio32Be, 0)
- ld [%o0 + %o1], %o0
- FUNCTION_END(xf86ReadMmio32Be)
-
- FUNCTION_START(xf86ReadMmio32Le, 0)
- lda [%o0 + %o1] 0x88, %o0
- FUNCTION_END(xf86ReadMmio32Le)
-
- FUNCTION_START(xf86WriteMmio8, 0)
- stba %o2, [%o0 + %o1] 0x88
- membar #StoreStore|#StoreLoad
- FUNCTION_END(xf86WriteMmio8)
-
- FUNCTION_START(xf86WriteMmio16Be, 0)
- sth %o2, [%o0 + %o1]
- membar #StoreStore|#StoreLoad
- FUNCTION_END(xf86WriteMmio16Be)
-
- FUNCTION_START(xf86WriteMmio16Le, 0)
- stha %o2, [%o0 + %o1] 0x88
- membar #StoreStore|#StoreLoad
- FUNCTION_END(xf86WriteMmio16Le)
-
- FUNCTION_START(xf86WriteMmio32Be, 0)
- st %o2, [%o0 + %o1]
- membar #StoreStore|#StoreLoad
- FUNCTION_END(xf86WriteMmio32Be)
-
- FUNCTION_START(xf86WriteMmio32Le, 0)
- sta %o2, [%o0 + %o1] 0x88
- membar #StoreStore|#StoreLoad
- FUNCTION_END(xf86WriteMmio32Le)
-
- FUNCTION_START(xf86WriteMmio8NB, 0)
- add %o0, %o1, %o0
- stba %o2, [%o0] 0x88
- FUNCTION_END(xf86WriteMmio8NB)
-
- FUNCTION_START(xf86WriteMmio16BeNB, 0)
- sth %o2, [%o0 + %o1]
- FUNCTION_END(xf86WriteMmio16BeNB)
-
- FUNCTION_START(xf86WriteMmio16LeNB, 0)
- stha %o2, [%o0 + %o1] 0x88
- FUNCTION_END(xf86WriteMmio16LeNB)
-
- FUNCTION_START(xf86WriteMmio32BeNB, 0)
- st %o2, [%o0 + %o1]
- FUNCTION_END(xf86WriteMmio32BeNB)
-
- FUNCTION_START(xf86WriteMmio32LeNB, 0)
- sta %o2, [%o0 + %o1] 0x88
- FUNCTION_END(xf86WriteMmio32LeNB)
-
+/* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef INLINE_ASM +#define FUNCTION_START(f,n) .inline f,n +#define FUNCTION_END(f) .end +#else +#define _ASM +#include <sys/asm_linkage.h> +#define FUNCTION_START(f,n) ENTRY(f) +#define FUNCTION_END(f) retl; nop; SET_SIZE(f) +#endif + +/* Converted from common/compiler.h gcc inline format to Sun cc inline + * format by Kenjiro Tsuji + * + * The value 0x88 means ASI_PRIMARY_LITTLE. + * The store or load to/from the address space will be done + * as little-endian. In the original xrog code, the value + * is defined as the macro ASI_PL. + * + * In the original xorg code, "membar #StoreStore|#StoreLoad" + * is directly implemented as an instruction "0x8143e00a". + * + */ + + FUNCTION_START(outb, 0) + stba %o1, [%o0] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(outb) + + FUNCTION_START(outw, 0) + stha %o1, [%o0] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(outw) + + FUNCTION_START(outl, 0) + sta %o1, [%o0] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(outl) + + FUNCTION_START(inb, 0) + lduba [%o0] 0x88, %o0 + FUNCTION_END(inb) + + FUNCTION_START(inw, 0) + lduha [%o0] 0x88, %o0 + FUNCTION_END(inw) + + FUNCTION_START(inl, 0) + lda [%o0] 0x88, %o0 + FUNCTION_END(inl) + + FUNCTION_START(xf86ReadMmio8, 0) + lduba [%o0 + %o1] 0x88, %o0 + FUNCTION_END(xf86ReadMmio8) + + FUNCTION_START(xf86ReadMmio16Be, 0) + lduh [%o0 + %o1], %o0 + FUNCTION_END(xf86ReadMmio16Be) + + FUNCTION_START(xf86ReadMmio16Le, 0) + lduha [%o0 + %o1] 0x88, %o0 + FUNCTION_END(xf86ReadMmio16Le) + + FUNCTION_START(xf86ReadMmio32Be, 0) + ld [%o0 + %o1], %o0 + FUNCTION_END(xf86ReadMmio32Be) + + FUNCTION_START(xf86ReadMmio32Le, 0) + lda [%o0 + %o1] 0x88, %o0 + FUNCTION_END(xf86ReadMmio32Le) + + FUNCTION_START(xf86WriteMmio8, 0) + stba %o2, [%o0 + %o1] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio8) + + FUNCTION_START(xf86WriteMmio16Be, 0) + sth %o2, [%o0 + %o1] + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio16Be) + + FUNCTION_START(xf86WriteMmio16Le, 0) + stha %o2, [%o0 + %o1] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio16Le) + + FUNCTION_START(xf86WriteMmio32Be, 0) + st %o2, [%o0 + %o1] + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio32Be) + + FUNCTION_START(xf86WriteMmio32Le, 0) + sta %o2, [%o0 + %o1] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio32Le) + + FUNCTION_START(xf86WriteMmio8NB, 0) + add %o0, %o1, %o0 + stba %o2, [%o0] 0x88 + FUNCTION_END(xf86WriteMmio8NB) + + FUNCTION_START(xf86WriteMmio16BeNB, 0) + sth %o2, [%o0 + %o1] + FUNCTION_END(xf86WriteMmio16BeNB) + + FUNCTION_START(xf86WriteMmio16LeNB, 0) + stha %o2, [%o0 + %o1] 0x88 + FUNCTION_END(xf86WriteMmio16LeNB) + + FUNCTION_START(xf86WriteMmio32BeNB, 0) + st %o2, [%o0 + %o1] + FUNCTION_END(xf86WriteMmio32BeNB) + + FUNCTION_START(xf86WriteMmio32LeNB, 0) + sta %o2, [%o0 + %o1] 0x88 + FUNCTION_END(xf86WriteMmio32LeNB) + diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_inout.s b/xorg-server/hw/xfree86/os-support/solaris/sun_inout.s index e8f03d0e8..c13ba8b2f 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/sun_inout.s +++ b/xorg-server/hw/xfree86/os-support/solaris/sun_inout.s @@ -1,124 +1,124 @@ -/ $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $ -/ -/ Copyright 1994-2001 The XFree86 Project, Inc. All Rights Reserved. -/ -/ Permission is hereby granted, free of charge, to any person obtaining a copy -/ of this software and associated documentation files (the "Software"), to deal -/ in the Software without restriction, including without limitation the rights -/ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/ copies of the Software, and to permit persons to whom the Software is -/ furnished to do so, subject to the following conditions: -/ -/ The above copyright notice and this permission notice shall be included in -/ all copies or substantial portions of the Software. -/ -/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/ XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -/ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -/ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/ -/ Except as contained in this notice, the name of the XFree86 Project shall not -/ be used in advertising or otherwise to promote the sale, use or other -/ dealings in this Software without prior written authorization from the -/ XFree86 Project. -/ -/ -/ File: sun_inout.s -/ -/ Purpose: Provide inb(), inw(), inl(), outb(), outw(), outl() functions -/ for Solaris x86 using the ProWorks compiler by SunPro -/ -/ Author: Installed into XFree86 SuperProbe by Doug Anson (danson@lgc.com) -/ Portions donated to XFree86 by Steve Dever (Steve.Dever@Eng.Sun.Com) -/ -/ Synopsis: (c callable external declarations) -/ extern unsigned char inb(int port); -/ extern unsigned short inw(int port); -/ extern unsigned long inl(int port); -/ extern void outb(int port, unsigned char value); -/ extern void outw(int port, unsigned short value); -/ extern void outl(int port, unsigned long value); -/ - -.file "sunos_inout.s" -.text - -.globl inb -.globl inw -.globl inl -.globl outb -.globl outw -.globl outl - -/ -/ unsigned char inb(int port); -/ -.align 4 -inb: - movl 4(%esp),%edx - subl %eax,%eax - inb (%dx) - ret -.type inb,@function -.size inb,.-inb - -/ -/ unsigned short inw(int port); -/ -.align 4 -inw: - movl 4(%esp),%edx - subl %eax,%eax - inw (%dx) - ret -.type inw,@function -.size inw,.-inw - -/ -/ unsigned long inl(int port); -/ -.align 4 -inl: - movl 4(%esp),%edx - inl (%dx) - ret -.type inl,@function -.size inl,.-inl - -/ -/ void outb(int port, unsigned char value); -/ -.align 4 -outb: - movl 4(%esp),%edx - movl 8(%esp),%eax - outb (%dx) - ret -.type outb,@function -.size outb,.-outb - -/ -/ void outw(int port, unsigned short value); -/ -.align 4 -outw: - movl 4(%esp),%edx - movl 8(%esp),%eax - outw (%dx) - ret -.type outw,@function -.size outw,.-outw - -/ -/ void outl(int port, unsigned long value); -/ -.align 4 -outl: - movl 4(%esp),%edx - movl 8(%esp),%eax - outl (%dx) - ret -.type outl,@function -.size outl,.-outl +/ $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $
+/
+/ Copyright 1994-2001 The XFree86 Project, Inc. All Rights Reserved.
+/
+/ Permission is hereby granted, free of charge, to any person obtaining a copy
+/ of this software and associated documentation files (the "Software"), to deal
+/ in the Software without restriction, including without limitation the rights
+/ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+/ copies of the Software, and to permit persons to whom the Software is
+/ furnished to do so, subject to the following conditions:
+/
+/ The above copyright notice and this permission notice shall be included in
+/ all copies or substantial portions of the Software.
+/
+/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+/ XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+/ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+/ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+/
+/ Except as contained in this notice, the name of the XFree86 Project shall not
+/ be used in advertising or otherwise to promote the sale, use or other
+/ dealings in this Software without prior written authorization from the
+/ XFree86 Project.
+/
+/
+/ File: sun_inout.s
+/
+/ Purpose: Provide inb(), inw(), inl(), outb(), outw(), outl() functions
+/ for Solaris x86 using the ProWorks compiler by SunPro
+/
+/ Author: Installed into XFree86 SuperProbe by Doug Anson (danson@lgc.com)
+/ Portions donated to XFree86 by Steve Dever (Steve.Dever@Eng.Sun.Com)
+/
+/ Synopsis: (c callable external declarations)
+/ extern unsigned char inb(int port);
+/ extern unsigned short inw(int port);
+/ extern unsigned long inl(int port);
+/ extern void outb(int port, unsigned char value);
+/ extern void outw(int port, unsigned short value);
+/ extern void outl(int port, unsigned long value);
+/
+
+.file "sunos_inout.s"
+.text
+
+.globl inb
+.globl inw
+.globl inl
+.globl outb
+.globl outw
+.globl outl
+
+/
+/ unsigned char inb(int port);
+/
+.align 4
+inb:
+ movl 4(%esp),%edx
+ subl %eax,%eax
+ inb (%dx)
+ ret
+.type inb,@function
+.size inb,.-inb
+
+/
+/ unsigned short inw(int port);
+/
+.align 4
+inw:
+ movl 4(%esp),%edx
+ subl %eax,%eax
+ inw (%dx)
+ ret
+.type inw,@function
+.size inw,.-inw
+
+/
+/ unsigned long inl(int port);
+/
+.align 4
+inl:
+ movl 4(%esp),%edx
+ inl (%dx)
+ ret
+.type inl,@function
+.size inl,.-inl
+
+/
+/ void outb(int port, unsigned char value);
+/
+.align 4
+outb:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ outb (%dx)
+ ret
+.type outb,@function
+.size outb,.-outb
+
+/
+/ void outw(int port, unsigned short value);
+/
+.align 4
+outw:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ outw (%dx)
+ ret
+.type outw,@function
+.size outw,.-outw
+
+/
+/ void outl(int port, unsigned long value);
+/
+.align 4
+outl:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ outl (%dx)
+ ret
+.type outl,@function
+.size outl,.-outl
|