mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-24 02:34:59 +00:00
On the alpha, ports may be allocated above 64k.
Change the port address argument to pci_map_port to pci_port_t* which is defined as u_int on the alpha, u_short on i386. This is a stopgap with a hopefully limited lifetime. Discussed with: Stefan Esser <se@freebsd.org>
This commit is contained in:
parent
0bf030847d
commit
df9efa9a8b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37841
|
@ -26,7 +26,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: pcivar.h,v 1.17 1997/08/21 07:05:54 fsmp Exp $
|
* $Id: pcivar.h,v 1.18 1997/08/21 08:31:41 fsmp Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -192,10 +192,16 @@ struct pci_lkm {
|
||||||
struct pci_lkm *next;
|
struct pci_lkm *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
typedef u_short pci_port_t;
|
||||||
|
#else
|
||||||
|
typedef u_int pci_port_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
u_long pci_conf_read (pcici_t tag, u_long reg);
|
u_long pci_conf_read (pcici_t tag, u_long reg);
|
||||||
void pci_conf_write (pcici_t tag, u_long reg, u_long data);
|
void pci_conf_write (pcici_t tag, u_long reg, u_long data);
|
||||||
void pci_configure (void);
|
void pci_configure (void);
|
||||||
int pci_map_port (pcici_t tag, u_long reg, u_short* pa);
|
int pci_map_port (pcici_t tag, u_long reg, pci_port_t* pa);
|
||||||
int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
|
int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
|
||||||
int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr);
|
int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr);
|
||||||
int pci_unmap_int (pcici_t tag);
|
int pci_unmap_int (pcici_t tag);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: pci_compat.c,v 1.6 1997/08/21 08:42:59 fsmp Exp $
|
* $Id: pci_compat.c,v 1.7 1998/04/01 21:07:37 tegge Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -56,7 +56,6 @@ static int
|
||||||
pci_mapno(pcicfgregs *cfg, int reg)
|
pci_mapno(pcicfgregs *cfg, int reg)
|
||||||
{
|
{
|
||||||
int map = -1;
|
int map = -1;
|
||||||
|
|
||||||
if ((reg & 0x03) == 0) {
|
if ((reg & 0x03) == 0) {
|
||||||
map = (reg -0x10) / 4;
|
map = (reg -0x10) / 4;
|
||||||
if (map < 0 || map >= cfg->nummaps)
|
if (map < 0 || map >= cfg->nummaps)
|
||||||
|
@ -106,7 +105,7 @@ pci_conf_write(pcici_t tag, u_long reg, u_long data)
|
||||||
pci_cfgwrite(tag, reg, data, 4);
|
pci_cfgwrite(tag, reg, data, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
int pci_map_port(pcici_t cfg, u_long reg, u_short* pa)
|
int pci_map_port(pcici_t cfg, u_long reg, pci_port_t* pa)
|
||||||
{
|
{
|
||||||
int map;
|
int map;
|
||||||
|
|
||||||
|
@ -149,7 +148,15 @@ int pci_map_mem(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
|
||||||
vm_offset_t vaddr;
|
vm_offset_t vaddr;
|
||||||
|
|
||||||
poffs = paddr - trunc_page(paddr);
|
poffs = paddr - trunc_page(paddr);
|
||||||
|
#ifdef __i386__
|
||||||
vaddr = (vm_offset_t)pmap_mapdev(paddr-poffs, psize+poffs);
|
vaddr = (vm_offset_t)pmap_mapdev(paddr-poffs, psize+poffs);
|
||||||
|
#endif
|
||||||
|
#ifdef __alpha__
|
||||||
|
/* XXX should talk to chipset.
|
||||||
|
Hardwire pyxis for now */
|
||||||
|
vaddr = ALPHA_PHYS_TO_K0SEG(0x8600000000L
|
||||||
|
+ paddr-poffs);
|
||||||
|
#endif
|
||||||
if (vaddr != NULL) {
|
if (vaddr != NULL) {
|
||||||
vaddr += poffs;
|
vaddr += poffs;
|
||||||
*va = vaddr;
|
*va = vaddr;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: pcivar.h,v 1.17 1997/08/21 07:05:54 fsmp Exp $
|
* $Id: pcivar.h,v 1.18 1997/08/21 08:31:41 fsmp Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -192,10 +192,16 @@ struct pci_lkm {
|
||||||
struct pci_lkm *next;
|
struct pci_lkm *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
typedef u_short pci_port_t;
|
||||||
|
#else
|
||||||
|
typedef u_int pci_port_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
u_long pci_conf_read (pcici_t tag, u_long reg);
|
u_long pci_conf_read (pcici_t tag, u_long reg);
|
||||||
void pci_conf_write (pcici_t tag, u_long reg, u_long data);
|
void pci_conf_write (pcici_t tag, u_long reg, u_long data);
|
||||||
void pci_configure (void);
|
void pci_configure (void);
|
||||||
int pci_map_port (pcici_t tag, u_long reg, u_short* pa);
|
int pci_map_port (pcici_t tag, u_long reg, pci_port_t* pa);
|
||||||
int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
|
int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
|
||||||
int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr);
|
int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr);
|
||||||
int pci_unmap_int (pcici_t tag);
|
int pci_unmap_int (pcici_t tag);
|
||||||
|
|
Loading…
Reference in a new issue