gt_pci.c (183174) | gt_pci.c (187251) |
---|---|
1/* $NetBSD: gt_pci.c,v 1.4 2003/07/15 00:24:54 lukem Exp $ */ 2 3/*- 4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc. 5 * All rights reserved. 6 * 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 8 * --- 26 unchanged lines hidden (view full) --- 35 * POSSIBILITY OF SUCH DAMAGE. 36 */ 37 38/* 39 * PCI configuration support for gt I/O Processor chip. 40 */ 41 42#include <sys/cdefs.h> | 1/* $NetBSD: gt_pci.c,v 1.4 2003/07/15 00:24:54 lukem Exp $ */ 2 3/*- 4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc. 5 * All rights reserved. 6 * 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 8 * --- 26 unchanged lines hidden (view full) --- 35 * POSSIBILITY OF SUCH DAMAGE. 36 */ 37 38/* 39 * PCI configuration support for gt I/O Processor chip. 40 */ 41 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: head/sys/mips/malta/gt_pci.c 183174 2008-09-19 04:16:13Z imp $"); | 43__FBSDID("$FreeBSD: head/sys/mips/malta/gt_pci.c 187251 2009-01-14 22:32:43Z gonzo $"); |
44 45#include <sys/param.h> 46#include <sys/systm.h> 47 48#include <sys/bus.h> 49#include <sys/interrupt.h> 50#include <sys/malloc.h> 51#include <sys/kernel.h> --- 400 unchanged lines hidden (view full) --- 452 { 453 reg_data = gt_pci_read_config(dev, bus, slot, func, reg, 4); 454 455 /* 456 * XXX: We assume that words readed from GT chip are BE. 457 * Should we set the mode explicitly during chip 458 * Initialization? 459 */ | 44 45#include <sys/param.h> 46#include <sys/systm.h> 47 48#include <sys/bus.h> 49#include <sys/interrupt.h> 50#include <sys/malloc.h> 51#include <sys/kernel.h> --- 400 unchanged lines hidden (view full) --- 452 { 453 reg_data = gt_pci_read_config(dev, bus, slot, func, reg, 4); 454 455 /* 456 * XXX: We assume that words readed from GT chip are BE. 457 * Should we set the mode explicitly during chip 458 * Initialization? 459 */ |
460 switch(reg % 4) 461 { 462 case 3: 463 shift = 24; 464 break; 465 case 2: 466 shift = 16; 467 break; 468 case 1: 469 shift = 8; 470 break; 471 default: 472 shift = 0; 473 break; 474 } | 460 shift = 8 * (reg & 3); |
475 476 switch(bytes) 477 { 478 case 1: 479 mask = 0xff; 480 data = (reg_data & ~ (mask << shift)) | (data << shift); 481 break; 482 case 2: --- 231 unchanged lines hidden --- | 461 462 switch(bytes) 463 { 464 case 1: 465 mask = 0xff; 466 data = (reg_data & ~ (mask << shift)) | (data << shift); 467 break; 468 case 2: --- 231 unchanged lines hidden --- |