#!/bin/sh
echo=echo
shar_tty= shar_n= shar_c='
'
mkdir _sh09806 || ( echo 'failed to create locking directory' '_sh09806'; exit 1 )
if test ! -d 'aperture'; then
$echo $echo_n 'x -' 'aperture: '$echo_c
if mkdir 'aperture'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'aperture/Makefile' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'aperture/Makefile' '(file already exists)'
else
$echo 'x -' extracting 'aperture/Makefile' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'aperture/Makefile' &&
XXXXXXXXXXXXXXXCC=gcc
XCFLGS=-fno-builtin -Wall -O3
X
XXXXX
XXXXX
XXXKERNEL_FLGS=-D_KERNEL -DSUNDDI
XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
XCFILES= aperture.c
XOBJS= aperture.o
XDRIVER= aperture
X
XXXall: $(DRIVER)
X
X$(DRIVER): $(OBJS)
X @if [ -f "Makefile.`uname -m`" ]; then \
X make -f Makefile.`uname -m` $(DRIVER); \
X else \
X rm -f $(DRIVER); \
X ld -r -o $(DRIVER) $(OBJS); \
X fi
X
Xinstall: $(DRIVER)
X @if [ -f "Makefile.`uname -m`" ]; then \
X make -f Makefile.`uname -m` install; \
X else \
X cp aperture.conf /kernel/drv; \
X cp $(DRIVER) /kernel/drv; \
X fi
X
Xadd_drv:
X @if [ -f "Makefile.`uname -m`" ]; then \
X make -f Makefile.`uname -m` add_drv; \
X else \
X add_drv /kernel/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.`uname -m`" ]; then \
X make -f Makefile.`uname -m` $@; \
X else \
X rm -f $@; \
X $(CC) -c $(CFLAGS) $*.c -o $@; \
X fi
SHAR_EOF
: || $echo 'restore of' 'aperture/Makefile' 'failed'
fi
if test -f 'aperture/README' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'aperture/README' '(file already exists)'
else
$echo 'x -' extracting 'aperture/README' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'aperture/README' &&
XFramebuffer apperture 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 corroborative work of
XDoug Anson (danson@lgc.com), and David Holland (davidh@use.com). It has since
Xbeen rewritten to also work on sun4u machines.
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'. The driver and test program should compile with out any
X problems. There also should not be any warning messages.
X
X3) Become 'root'.
X
X4) type 'make install' and 'make add_drv'. The screen should look something
X like this:
X
X X cp aperture aperture.conf /kernel/drv
X X add_drv /kernel/drv/aperture
X
X On a sun4u machine this will mention the /kernel/drv/sparcv9 directory
X instead of /kernel/drv.
X
X This installs the driver in the system.
X
X5) While as root modify the file /etc/devlink.tab, adding these lines:
X
XXtype=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 X X
XBug reports, questions, suggestions, etc can be sent to xfree86@xfree86.org.
SHAR_EOF
: || $echo 'restore of' 'aperture/README' 'failed'
fi
if test -f 'aperture/aperture.c' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'aperture/aperture.c' '(file already exists)'
else
$echo 'x -' extracting 'aperture/aperture.c' '(text)'
sed 's/^X//' << 'SHAR_EOF' > '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
XXXXXXX
XXX
XXXX
XXXX
X/*
X * open(9E)
X */
X/*ARGSUSED*/
Xstatic int
Xaperture_open
X(
XX dev_t *devp,
X int flag,
X int typ,
X struct cred *cred
XX)
XX dev_t *devp;
X int flag;
X int typ;
X struct cred *cred;
XX{
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering open()\n");
X
XX
X if ((typ != OTYP_CHR) || (getminor(*devp)))
X error = EINVAL;
X else
X error = 0;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving open() = %d\n", error);
X
XX
X return error;
X}
X
X/*
X * mmap(9E)
X */
X/*ARGSUSED*/
Xstatic int
Xaperture_mmap
X(
XX dev_t dev,
X off_t off,
X int prot
XX)
XX dev_t dev;
X off_t off;
X int prot;
XX{
X pfn_t pf;
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering mmap(0x%016lx)\n", off);
X
XX
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
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving mmap() = 0x%08lx", error);
X
XX
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(
XX dev_info_t *dip,
X ddi_info_cmd_t infocmd,
X void *arg,
X void **result
XX)
XX dev_info_t *dip;
X ddi_info_cmd_t infocmd;
X void *arg;
X void **result;
XX{
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering getinfo()\n");
X
XX
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
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving getinfo() = %d\n", error);
X
XX
X return error;
X}
X
X/*
X * identify(9E)
X */
X/*ARGSUSED*/
Xstatic int
Xaperture_identify
X(
XX dev_info_t *dip
XX)
XX dev_info_t *dip;
XX{
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering identify()\n");
X
XX
X if (strcmp(ddi_get_name(dip), DEV_IDENT))
X error = DDI_NOT_IDENTIFIED;
X else
X error = DDI_IDENTIFIED;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving identify() = %d\n", error);
X
XX
X return error;
X}
X
X/*
X * attach(9E)
X */
X/*ARGSUSED*/
Xstatic int
Xaperture_attach
X(
XX dev_info_t *dip,
X ddi_attach_cmd_t cmd
XX)
XX dev_info_t *dip;
X ddi_attach_cmd_t cmd;
XX{
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering attach()\n");
X
XX
X if (cmd != DDI_ATTACH)
X {
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": not attach(, DDI_ATTACH)\n");
X
XX
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, NODESPECIFIC_DEV);
X
X if (error == DDI_SUCCESS)
X {
X aperture_dip = dip;
X ddi_report_dev(dip);
X }
X }
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving attach() = %d\n", error);
X
XX
X return error;
X}
X
X/*
X * detach(9E)
X */
Xstatic int
Xaperture_detach
X(
XX dev_info_t *dip,
X ddi_detach_cmd_t cmd
XX)
XX dev_info_t *dip;
X ddi_detach_cmd_t cmd;
XX{
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering detach()\n");
X
XX
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
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving detach() = %d\n", error);
X
XX
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(
XX void
XX)
X{
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering _init()\n");
X
XX
X error = mod_install(&modlinkage);
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving _init() = %d\n", error);
X
XX
X return error;
X}
X
X/*
X * _info(9E)
X */
Xint
X_info
X(
XX struct modinfo *modinfop
XX)
XX struct modinfo *modinfop;
XX{
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering _info()\n");
X
XX
X error = mod_info(&modlinkage, modinfop);
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving _info() = %d\n", error);
X
XX
X return error;
X}
X
X/*
X * _fini(9E)
X */
Xint
X_fini
X(
XX void
XX)
X{
X int error;
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": entering _fini()\n");
X
XX
X error = mod_remove(&modlinkage);
X
XX
X cmn_err(CE_CONT, DEV_IDENT ": leaving _fini() = %d\n", error);
X
XX
X return error;
X}
SHAR_EOF
: || $echo 'restore of' 'aperture/aperture.c' 'failed'
fi
if test -f 'aperture/aperture.conf' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'aperture/aperture.conf' '(file already exists)'
else
$echo 'x -' extracting 'aperture/aperture.conf' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'aperture/aperture.conf' &&
XXXXXXXXXXXXXXXXname="aperture" parent="pseudo";
SHAR_EOF
: || $echo 'restore of' 'aperture/aperture.conf' 'failed'
fi
if test -f 'aperture/devlink.tab' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'aperture/devlink.tab' '(file already exists)'
else
$echo 'x -' extracting 'aperture/devlink.tab' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'aperture/devlink.tab' &&
XXtype=ddi_pseudo;name=aperture fbs/\M0
SHAR_EOF
: || $echo 'restore of' 'aperture/devlink.tab' 'failed'
fi
if test -f 'aperture/Makefile.sun4u' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'aperture/Makefile.sun4u' '(file already exists)'
else
$echo 'x -' extracting 'aperture/Makefile.sun4u' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'aperture/Makefile.sun4u' &&
XXXXXXXXXXXX
XXXXCC=gcc
XCFLGS=-fno-builtin -Wall -O3 -m64
X
XXXXX
XXXXX
XXXKERNEL_FLGS=-D_KERNEL -DSUNDDI
XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
XCFILES= aperture.c
XOBJS= aperture.o
XDRIVER= aperture
X
XXXall: $(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 /kernel/drv/sparcv9/aperture
X
Xclean:
X rm -f *% *.BAK $(OBJS) $(DRIVER) core
X
X.SUFFIXES: .i
X
X.c.i:
X $(CC) -E $(CFLAGS) $*.c > $@
SHAR_EOF
: || $echo 'restore of' 'aperture/Makefile.sun4u' 'failed'
fi
$echo $shar_n 'x -' 'lock directory' "\`_sh09806': " $shar_c
if rm -fr _sh09806; then
$echo 'removed'
else
$echo 'failed to remove'
fi
exit 0