Skip to content

Commit 3a2c8c2

Browse files
author
stefanct
committed
Move global io_base_addr into compilation units.
Signed-off-by: Stefan Tauner <[email protected]> Acked-by: Carl-Daniel Hailfinger <[email protected]> git-svn-id: svn://flashrom.org/flashrom/trunk@1813 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
1 parent ec28c55 commit 3a2c8c2

File tree

10 files changed

+10
-7
lines changed

10 files changed

+10
-7
lines changed

atahpt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
#define PCI_VENDOR_ID_HPT 0x1103
3535

36+
static uint32_t io_base_addr = 0;
37+
3638
const struct dev_entry ata_hpt[] = {
3739
{0x1103, 0x0004, NT, "Highpoint", "HPT366/368/370/370A/372/372N"},
3840
{0x1103, 0x0005, NT, "Highpoint", "HPT372A/372N"},

gfxnvidia.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int gfxnvidia_init(void)
8989
if (!dev)
9090
return 1;
9191

92-
io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
92+
uint32_t io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
9393
if (!io_base_addr)
9494
return 1;
9595

it8212.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int it8212_init(void)
5959
return 1;
6060

6161
/* Bit 0 is address decode enable, 17-31 the base address, everything else reserved/zero. */
62-
io_base_addr = pcidev_readbar(dev, PCI_ROM_ADDRESS) & 0xFFFFFFFE;
62+
uint32_t io_base_addr = pcidev_readbar(dev, PCI_ROM_ADDRESS) & 0xFFFFFFFE;
6363
if (!io_base_addr)
6464
return 1;
6565

nic3com.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#define PCI_VENDOR_ID_3COM 0x10b7
3535

36+
static uint32_t io_base_addr = 0;
3637
static uint32_t internal_conf;
3738
static uint16_t id;
3839

nicintel_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ int nicintel_spi_init(void)
179179
if (!dev)
180180
return 1;
181181

182-
io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
182+
uint32_t io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
183183
if (!io_base_addr)
184184
return 1;
185185

nicnatsemi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define BOOT_ROM_ADDR 0x50
3131
#define BOOT_ROM_DATA 0x54
3232

33+
static uint32_t io_base_addr = 0;
3334
const struct dev_entry nics_natsemi[] = {
3435
{0x100b, 0x0020, NT, "National Semiconductor", "DP83815/DP83816"},
3536
{0x100b, 0x0022, NT, "National Semiconductor", "DP83820"},

nicrealtek.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#define PCI_VENDOR_ID_REALTEK 0x10ec
2929
#define PCI_VENDOR_ID_SMC1211 0x1113
3030

31+
static uint32_t io_base_addr = 0;
3132
static int bios_rom_addr, bios_rom_data;
3233

3334
const struct dev_entry nics_realtek[] = {

ogp_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ int ogp_spi_init(void)
132132
if (!dev)
133133
return 1;
134134

135-
io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
135+
uint32_t io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
136136
if (!io_base_addr)
137137
return 1;
138138

pcidev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "programmer.h"
2626
#include "hwaccess.h"
2727

28-
uint32_t io_base_addr;
2928
struct pci_access *pacc;
3029

3130
enum pci_bartype {

programmer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ struct bitbang_spi_master {
173173
struct pci_dev;
174174

175175
/* pcidev.c */
176-
// FIXME: These need to be local, not global
177-
extern uint32_t io_base_addr;
176+
// FIXME: This needs to be local, not global(?)
178177
extern struct pci_access *pacc;
179178
int pci_init_common(void);
180179
uintptr_t pcidev_readbar(struct pci_dev *dev, int bar);

0 commit comments

Comments
 (0)