From alsa-devel-owner@alsa.jcu.cz  Mon Oct 26 20:25:16 1998
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id UAA12414;
	Mon, 26 Oct 1998 20:25:03 +0100
Date: Mon, 26 Oct 1998 20:25:03 +0100 (CET)
From: Jaroslav Kysela <perex@jcu.cz>
To: Fred Floberg <emng@geocities.com>
cc: alsa-devel@jcu.cz
Subject: Re: ES1371 bug hunting question
In-Reply-To: <Pine.LNX.3.95.981026134143.705A-100000@cyphyn.219.org>
Message-ID: <Pine.LNX.3.96.981026202141.26472A-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Mon, 26 Oct 1998, Fred Floberg wrote:

> However, in snd_ensoniq_create(.... struct snd_pci_dev *pci ....)
> that unsigned int is being initialized with an unsigned long:
> 
>         alsa-driver/lowlevel/pci/es1370.c, line 995:
> 
> ensoniq -> port = pci -> base_address[ 0 ] & ~PCI_BASE_ADDRESS_SPACE;
> 
> In alsa-driver/include/sndpci.h, line 40, I find:
> 
> struct snd_pci_dev {
>        ....
>        unsigned long base_address[6];
>        ....
> };
> 
> So it looks as though the initialization in snd_ensoniq_create(...)
> would cause overflow of the structure member ensoniq -> port, possibly
> causing inl( ensoniq -> port + 0x14 ) to read from the wrong location.
> 
> Am I missing something here?

Yes, 99% of PCs at current market have 32-bit PCI BUS only, thus addresses
cannot be above this limit, so 32-bit value is enough.

Next thing is i386 in/out instructions which have only 16-bit range.
I'm using 32-bit variable only for use with other platforms which should
use full 32-bit addresses...

							Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


