Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amigappc/amigappc This was committed accidentally.
details: https://anonhg.NetBSD.org/src/rev/e45234026e88
branches: trunk
changeset: 487283:e45234026e88
user: is <is%NetBSD.org@localhost>
date: Mon Jun 05 21:40:34 2000 +0000
description:
This was committed accidentally.
diffstat:
sys/arch/amigappc/amigappc/cc.c | 719 ----------------------------------------
1 files changed, 0 insertions(+), 719 deletions(-)
diffs (truncated from 723 to 300 lines):
diff -r c8adffecfbfc -r e45234026e88 sys/arch/amigappc/amigappc/cc.c
--- a/sys/arch/amigappc/amigappc/cc.c Mon Jun 05 21:37:33 2000 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,719 +0,0 @@
-/* $NetBSD: cc.c,v 1.1 2000/05/25 22:11:57 is Exp $ */
-
-/*
- * Copyright (c) 1994 Christian E. Hopps
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Christian E. Hopps.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/queue.h>
-
-#include <amiga/amiga/custom.h>
-#include <amiga/amiga/cc.h>
-#include "audio.h"
-
-#if defined (__GNUC__)
-#define INLINE inline
-#else
-#define INLINE
-#endif
-
-#ifdef __powerpc__
-#define PPC_CC_SYNC asm volatile ("eieio");
-#endif
-
-/* init all the "custom chips" */
-void
-custom_chips_init()
-{
- cc_init_chipmem();
- cc_init_vbl();
- cc_init_audio();
- cc_init_blitter();
- cc_init_copper();
-}
-
-/*
- * Vertical blank iterrupt sever chains.
- */
-LIST_HEAD(vbllist, vbl_node) vbl_list;
-
-void
-turn_vbl_function_off(n)
- struct vbl_node *n;
-{
- if (n->flags & VBLNF_OFF)
- return;
-
- n->flags |= VBLNF_TURNOFF;
- while ((n->flags & VBLNF_OFF) == 0)
- ;
-}
-
-/* allow function to be called on next vbl interrupt. */
-void
-turn_vbl_function_on(n)
- struct vbl_node *n;
-{
- n->flags &= (short) ~(VBLNF_OFF);
-}
-
-void
-add_vbl_function(add, priority, data)
- struct vbl_node *add;
- short priority;
- void *data;
-{
- int s;
- struct vbl_node *n, *prev;
-
- s = spl3();
- prev = NULL;
- for (n = vbl_list.lh_first; n != NULL; n = n->link.le_next) {
- if (add->priority > n->priority) {
- /* insert add_node before. */
- if (prev == NULL) {
- LIST_INSERT_HEAD(&vbl_list, add, link);
- } else {
- LIST_INSERT_AFTER(prev, add, link);
- }
- add = NULL;
- break;
- }
- prev = n;
- }
- if (add) {
- if (prev == NULL) {
- LIST_INSERT_HEAD(&vbl_list, add, link);
- } else {
- LIST_INSERT_AFTER(prev, add, link);
- }
- }
- splx(s);
-}
-
-void
-remove_vbl_function(n)
- struct vbl_node *n;
-{
- int s;
-
- s = spl3();
- LIST_REMOVE(n, link);
- splx(s);
-}
-
-/* Level 3 hardware interrupt */
-void
-vbl_handler()
-{
- struct vbl_node *n;
-
- /* handle all vbl functions */
- for (n = vbl_list.lh_first; n != NULL; n = n->link.le_next) {
- if (n->flags & VBLNF_TURNOFF) {
- n->flags |= VBLNF_OFF;
- n->flags &= ~(VBLNF_TURNOFF);
- } else {
- if (n != NULL)
- n->function(n->data);
- }
- }
- custom.intreq = INTF_VERTB;
- PPC_CC_SYNC
-}
-
-void
-cc_init_vbl()
-{
- LIST_INIT(&vbl_list);
- /*
- * enable vertical blank interrupts
- */
- custom.intena = INTF_SETCLR | INTF_VERTB;
- PPC_CC_SYNC
-}
-
-
-/*
- * Blitter stuff.
- */
-
-void
-cc_init_blitter()
-{
-}
-
-/* test twice to cover blitter bugs if BLTDONE (BUSY) is set it is not done. */
-int
-is_blitter_busy()
-{
- u_short bb;
-
- bb = (custom.dmaconr & DMAF_BLTDONE);
- PPC_CC_SYNC
- if ((custom.dmaconr & DMAF_BLTDONE) || bb)
- {
- PPC_CC_SYNC
- return (1);
- }
- return (0);
-}
-
-void
-wait_blit()
-{
- /*
- * V40 state this covers all blitter bugs.
- */
- while (is_blitter_busy())
- ;
-}
-
-void
-blitter_handler()
-{
- custom.intreq = INTF_BLIT;
- PPC_CC_SYNC
-}
-
-
-void
-do_blit(size)
- u_short size;
-{
- custom.bltsize = size;
- PPC_CC_SYNC
-}
-
-void
-set_blitter_control(con0, con1)
- u_short con0, con1;
-{
- custom.bltcon0 = con0;
- PPC_CC_SYNC
- custom.bltcon1 = con1;
- PPC_CC_SYNC
-}
-
-void
-set_blitter_mods(a, b, c, d)
- u_short a, b, c, d;
-{
- custom.bltamod = a;
- PPC_CC_SYNC
- custom.bltbmod = b;
- PPC_CC_SYNC
- custom.bltcmod = c;
- PPC_CC_SYNC
- custom.bltdmod = d;
- PPC_CC_SYNC
-}
-
-void
-set_blitter_masks(fm, lm)
- u_short fm, lm;
-{
- custom.bltafwm = fm;
- PPC_CC_SYNC
- custom.bltalwm = lm;
- PPC_CC_SYNC
-}
-
-void
-set_blitter_data(da, db, dc)
- u_short da, db, dc;
-{
- custom.bltadat = da;
- PPC_CC_SYNC
- custom.bltbdat = db;
- PPC_CC_SYNC
- custom.bltcdat = dc;
- PPC_CC_SYNC
-}
-
-void
-set_blitter_pointers(a, b, c, d)
- void *a, *b, *c, *d;
-{
- custom.bltapt = a;
- PPC_CC_SYNC
- custom.bltbpt = b;
- PPC_CC_SYNC
- custom.bltcpt = c;
- PPC_CC_SYNC
- custom.bltdpt = d;
- PPC_CC_SYNC
-}
-
-/*
- * Copper Stuff.
- */
-
-
-/*
- * Wait till end of frame. We should probably better use the
- * sleep/wakeup system newly introduced in the vbl manager
- */
-void
-wait_tof()
-{
- /*
- * wait until bottom of frame.
- */
- while ((custom.vposr & 0x0007) == 0)
- PPC_CC_SYNC;
-
- /*
- * wait until until top of frame.
- */
- while (custom.vposr & 0x0007)
Home |
Main Index |
Thread Index |
Old Index