Convert the pcib_{read,write}_config args from signed to unsigned,

like the args to the config space accessors these functions replaced.

This reduces the likelyhood of overflow when the args are used in
macros on the alpha.  This prevents memory management faults when
probing the pci bus on sables, multias and nonames.

Approved by: dfr
Tested by: Bernd Walter <ticso@cicely8.cicely.de>
This commit is contained in:
Andrew Gallatin 2000-12-01 15:27:48 +00:00
parent 280a27d267
commit 689634a3ea
10 changed files with 45 additions and 45 deletions

View File

@ -134,8 +134,8 @@ apecs_pcib_maxslots(device_t dev)
} while (0)
u_int32_t
apecs_pcib_read_config(device_t dev, int b, int s, int f,
int reg, int width)
apecs_pcib_read_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, int width)
{
switch (width) {
case 1:
@ -151,8 +151,8 @@ apecs_pcib_read_config(device_t dev, int b, int s, int f,
}
static void
apecs_pcib_write_config(device_t dev, int b, int s, int f,
int reg, u_int32_t val, int width)
apecs_pcib_write_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, u_int32_t val, int width)
{
switch (width) {
case 1:

View File

@ -29,5 +29,5 @@
struct device;
extern void apecs_init(void);
u_int32_t apecs_pcib_read_config(struct device *dev, int b, int s, int f,
int reg, int width);
u_int32_t apecs_pcib_read_config(struct device *dev, u_int b, u_int s, u_int f,
u_int reg, int width);

View File

@ -298,7 +298,7 @@ cia_check_abort(void)
} while (0)
static u_int32_t
cia_pcib_swiz_read_config(int b, int s, int f, int reg, int width)
cia_pcib_swiz_read_config(u_int b, u_int s, u_int f, u_int reg, int width)
{
switch (width) {
case 1:
@ -314,7 +314,7 @@ cia_pcib_swiz_read_config(int b, int s, int f, int reg, int width)
}
static void
cia_pcib_swiz_write_config(int b, int s, int f, int reg,
cia_pcib_swiz_write_config(u_int b, u_int s, u_int f, u_int reg,
u_int32_t val, int width)
{
switch (width) {
@ -330,7 +330,7 @@ cia_pcib_swiz_write_config(int b, int s, int f, int reg,
}
static u_int32_t
cia_pcib_bwx_read_config(int b, int s, int f, int reg, int width)
cia_pcib_bwx_read_config(u_int b, u_int s, u_int f, u_int reg, int width)
{
switch (width) {
case 1:
@ -346,8 +346,8 @@ cia_pcib_bwx_read_config(int b, int s, int f, int reg, int width)
}
static void
cia_pcib_bwx_write_config(int b, int s, int f, int reg,
u_int32_t val, int width)
cia_pcib_bwx_write_config(u_int b, u_int s, u_int f, u_int reg,
u_int32_t val, u_int width)
{
switch (width) {
case 1:

View File

@ -147,8 +147,8 @@ irongate_check_abort(void)
} while (0)
static u_int32_t
irongate_pcib_read_config(device_t dev, int b, int s, int f,
int reg, int width)
irongate_pcib_read_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, int width)
{
switch (width) {
case 1:
@ -164,8 +164,8 @@ irongate_pcib_read_config(device_t dev, int b, int s, int f,
}
static void
irongate_pcib_write_config(device_t dev, int b, int s, int f,
int reg, u_int32_t val, int width)
irongate_pcib_write_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, u_int32_t val, int width)
{
switch (width) {
case 1:

View File

@ -130,8 +130,8 @@ lca_pcib_maxslots(device_t dev)
} while (0)
u_int32_t
lca_pcib_read_config(device_t dev, int b, int s, int f,
int reg, int width)
lca_pcib_read_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, int width)
{
switch (width) {
case 1:
@ -147,8 +147,8 @@ lca_pcib_read_config(device_t dev, int b, int s, int f,
}
static void
lca_pcib_write_config(device_t dev, int b, int s, int f,
int reg, u_int32_t val, int width)
lca_pcib_write_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, u_int32_t val, int width)
{
switch (width) {
case 1:

View File

@ -29,5 +29,5 @@
struct device;
extern void lca_init(void);
u_int32_t lca_pcib_read_config(struct device *dev, int b, int s, int f,
int reg, int width);
u_int32_t lca_pcib_read_config(struct device *dev, u_int b, u_int s, u_int f,
u_int reg, int width);

View File

@ -136,8 +136,8 @@ t2_pcib_maxslots(device_t dev)
} while (0)
static u_int32_t
t2_pcib_read_config(device_t dev, int b, int s, int f,
int reg, int width)
t2_pcib_read_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, int width)
{
switch (width) {
case 1:
@ -153,8 +153,8 @@ t2_pcib_read_config(device_t dev, int b, int s, int f,
}
static void
t2_pcib_write_config(device_t dev, int b, int s, int f,
int reg, u_int32_t val, int width)
t2_pcib_write_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, u_int32_t val, int width)
{
switch (width) {
case 1:

View File

@ -217,8 +217,8 @@ tsunami_check_abort(void)
} while (0)
static u_int32_t
tsunami_pcib_read_config(device_t dev, int b, int s, int f,
int reg, int width)
tsunami_pcib_read_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, int width)
{
int h = device_get_unit(dev);
switch (width) {
@ -235,8 +235,8 @@ tsunami_pcib_read_config(device_t dev, int b, int s, int f,
}
static void
tsunami_pcib_write_config(device_t dev, int b, int s, int f,
int reg, u_int32_t val, int width)
tsunami_pcib_write_config(device_t dev, u_int b, u_int s, u_int f,
u_int reg, u_int32_t val, int width)
{
int h = device_get_unit(dev);
switch (width) {

View File

@ -46,10 +46,10 @@ METHOD int maxslots {
#
METHOD u_int32_t read_config {
device_t dev;
int bus;
int slot;
int func;
int reg;
u_int bus;
u_int slot;
u_int func;
u_int reg;
int width;
};
@ -62,10 +62,10 @@ METHOD u_int32_t read_config {
#
METHOD void write_config {
device_t dev;
int bus;
int slot;
int func;
int reg;
u_int bus;
u_int slot;
u_int func;
u_int reg;
u_int32_t value;
int width;
};

View File

@ -46,10 +46,10 @@ METHOD int maxslots {
#
METHOD u_int32_t read_config {
device_t dev;
int bus;
int slot;
int func;
int reg;
u_int bus;
u_int slot;
u_int func;
u_int reg;
int width;
};
@ -62,10 +62,10 @@ METHOD u_int32_t read_config {
#
METHOD void write_config {
device_t dev;
int bus;
int slot;
int func;
int reg;
u_int bus;
u_int slot;
u_int func;
u_int reg;
u_int32_t value;
int width;
};