Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Mar 1997 14:39:08 -0700
From:      Steve Passe <smp@csn.net>
To:        Amancio Hasty <hasty@rah.star-gate.com>
Cc:        multimedia@FreeBSD.ORG
Subject:   INTs on the bt848
Message-ID:  <199703212139.OAA25157@Ilsa.StevesCafe.com>

next in thread | raw e-mail | index | archive | help
Hi,

I have been looking over the INT code and have the following questions:

in bktr_intr, near the top you attempt to access the device status register:
 ...
	bt_reg = (u_char *) &bt848;
	s_status = *bt_reg;
	*bt_reg = 0;

this code takes the addr of the pointer, then sets s_status to the pointer
value, NOT the thing it points @, ie bt848 is already a u_char*. so
your doing double indirection.

shouldn't this be:
	s_status = *bt848;
	*bt848 = 0;
---
a little further down you read the int status register:

	btl_reg = (u_long *) &bt848[BKTR_INT_STAT];
	bktr_status = *btl_reg ;
	*btl_reg = *btl_reg;
	*btl_reg = 0;

line 3 clears all the set bits, but line 4 doesn't accomplish anything that
I can see, based on the databook, p 107, since a 0 in a bit field has
no effect.  shouldn'tline 4 be removed?

---
in bktr_open() you access the device status register again:

	*bt848 = 0x3;
	*bt848 = 0xc0;

what is this attempting to do? 

the databook, page 87, says only the 2 low bits hold values, and my
experiments with reading/clearing it show that writting a 0 bit
to the filed is what will clear it.

shouldn't this be changed to:

	*bt848 = 0x00;

--
Steve Passe	| powered by 
smp@csn.net	|            Symmetric MultiProcessor FreeBSD




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703212139.OAA25157>