projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2e1ad31
)
fix-iomem-arithmetic.patch (applied cleanly)
author
Ben Pfaff
<blp@cs.stanford.edu>
Fri, 12 Dec 2008 05:06:13 +0000
(21:06 -0800)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Fri, 12 Dec 2008 05:06:13 +0000
(21:06 -0800)
src/devices/pci.c
patch
|
blob
|
history
diff --git
a/src/devices/pci.c
b/src/devices/pci.c
index 2df8e2ae4022c8c203a3b2cfcbe5d5c13bf96e9d..cb368e1244b67d86d2a2d003f8667e100f49be30 100644
(file)
--- a/
src/devices/pci.c
+++ b/
src/devices/pci.c
@@
-329,7
+329,7
@@
pci_reg_write8 (struct pci_io *pio, int reg, uint8_t data)
if (pio->type == PCI_IO_MEM)
{
if (pio->type == PCI_IO_MEM)
{
-
((uint8_t *) pio->addr.ptr)[reg]
= data;
+
*((uint8_t *) (pio->addr.ptr + reg))
= data;
}
else if (pio->type == PCI_IO_PORT)
{
}
else if (pio->type == PCI_IO_PORT)
{
@@
-349,7
+349,7
@@
pci_reg_read32 (struct pci_io *pio, int reg)
if (pio->type == PCI_IO_MEM)
{
if (pio->type == PCI_IO_MEM)
{
- ret =
((uint32_t *) pio->addr.ptr)[reg]
;
+ ret =
*((uint32_t *) (pio->addr.ptr + reg))
;
}
else if (pio->type == PCI_IO_PORT)
{
}
else if (pio->type == PCI_IO_PORT)
{
@@
-372,7
+372,7
@@
pci_reg_read16 (struct pci_io * pio, int reg)
ret = 0;
if (pio->type == PCI_IO_MEM)
{
ret = 0;
if (pio->type == PCI_IO_MEM)
{
- ret =
((uint16_t *) pio->addr.ptr)[reg]
;
+ ret =
*((uint16_t *) (pio->addr.ptr + reg))
;
}
else if (pio->type == PCI_IO_PORT)
{
}
else if (pio->type == PCI_IO_PORT)
{
@@
-395,7
+395,7
@@
pci_reg_read8 (struct pci_io * pio, int reg)
if (pio->type == PCI_IO_MEM)
{
if (pio->type == PCI_IO_MEM)
{
- ret =
((uint8_t *) pio->addr.ptr)[reg]
;
+ ret =
*((uint8_t *) (pio->addr.ptr + reg))
;
}
else if (pio->type == PCI_IO_PORT)
{
}
else if (pio->type == PCI_IO_PORT)
{