diff options
author | gallatin <gallatin@FreeBSD.org> | 2000-12-01 15:27:48 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 2000-12-01 15:27:48 +0000 |
commit | f3693740f3994723ae463b65c2ca1ba2bd1f063c (patch) | |
tree | b64996992392b03927ef23bbc7f9eb5e698a61f2 | |
parent | 700fece2f363b189cbf2531a212f9895b1394808 (diff) | |
download | FreeBSD-src-f3693740f3994723ae463b65c2ca1ba2bd1f063c.zip FreeBSD-src-f3693740f3994723ae463b65c2ca1ba2bd1f063c.tar.gz |
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>
-rw-r--r-- | sys/alpha/pci/apecs_pci.c | 8 | ||||
-rw-r--r-- | sys/alpha/pci/apecsvar.h | 4 | ||||
-rw-r--r-- | sys/alpha/pci/cia_pci.c | 10 | ||||
-rw-r--r-- | sys/alpha/pci/irongate_pci.c | 8 | ||||
-rw-r--r-- | sys/alpha/pci/lca_pci.c | 8 | ||||
-rw-r--r-- | sys/alpha/pci/lcavar.h | 4 | ||||
-rw-r--r-- | sys/alpha/pci/t2_pci.c | 8 | ||||
-rw-r--r-- | sys/alpha/pci/tsunami_pci.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/pcib_if.m | 16 | ||||
-rw-r--r-- | sys/pci/pcib_if.m | 16 |
10 files changed, 45 insertions, 45 deletions
diff --git a/sys/alpha/pci/apecs_pci.c b/sys/alpha/pci/apecs_pci.c index d262013..7030111 100644 --- a/sys/alpha/pci/apecs_pci.c +++ b/sys/alpha/pci/apecs_pci.c @@ -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: diff --git a/sys/alpha/pci/apecsvar.h b/sys/alpha/pci/apecsvar.h index 56ade54..2c6987e 100644 --- a/sys/alpha/pci/apecsvar.h +++ b/sys/alpha/pci/apecsvar.h @@ -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); diff --git a/sys/alpha/pci/cia_pci.c b/sys/alpha/pci/cia_pci.c index 1ccb618..aa09f41 100644 --- a/sys/alpha/pci/cia_pci.c +++ b/sys/alpha/pci/cia_pci.c @@ -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: diff --git a/sys/alpha/pci/irongate_pci.c b/sys/alpha/pci/irongate_pci.c index 14278be..00c90aa 100644 --- a/sys/alpha/pci/irongate_pci.c +++ b/sys/alpha/pci/irongate_pci.c @@ -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: diff --git a/sys/alpha/pci/lca_pci.c b/sys/alpha/pci/lca_pci.c index cd7ae9d..36ede70 100644 --- a/sys/alpha/pci/lca_pci.c +++ b/sys/alpha/pci/lca_pci.c @@ -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: diff --git a/sys/alpha/pci/lcavar.h b/sys/alpha/pci/lcavar.h index 2f22ade..ee53b75 100644 --- a/sys/alpha/pci/lcavar.h +++ b/sys/alpha/pci/lcavar.h @@ -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); diff --git a/sys/alpha/pci/t2_pci.c b/sys/alpha/pci/t2_pci.c index 687aa17..4424ed9 100644 --- a/sys/alpha/pci/t2_pci.c +++ b/sys/alpha/pci/t2_pci.c @@ -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: diff --git a/sys/alpha/pci/tsunami_pci.c b/sys/alpha/pci/tsunami_pci.c index cd392e1..f4a190b 100644 --- a/sys/alpha/pci/tsunami_pci.c +++ b/sys/alpha/pci/tsunami_pci.c @@ -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) { diff --git a/sys/dev/pci/pcib_if.m b/sys/dev/pci/pcib_if.m index 2b38ef7..5224778 100644 --- a/sys/dev/pci/pcib_if.m +++ b/sys/dev/pci/pcib_if.m @@ -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; }; diff --git a/sys/pci/pcib_if.m b/sys/pci/pcib_if.m index 2b38ef7..5224778 100644 --- a/sys/pci/pcib_if.m +++ b/sys/pci/pcib_if.m @@ -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; }; |