Emergency patch for an ancient bug in device_util.c, self-acked:

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: : Ronald G. Minnich <rminnich@gmail.com>
smbus_ops patched
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@758 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Ronald G. Minnich 2008-08-14 00:02:27 +00:00
commit 99792d89fc
3 changed files with 18 additions and 3 deletions

View file

@ -95,5 +95,19 @@ config SUSPEND_TO_RAM
help
Enable support for Suspend-to-RAM (S3) functionality.
endmenu
config PCI_64BIT_PREF_MEM
bool "64 bit prefetchable memory addresses"
help
Enable support for 64-bit prefetchable memory addresses in PCI.
config HW_MEM_HOLE_SIZEK
hex "HW memory hole size in KB"
default 0x1000
help
Some chipsets support setting up a "hole" at the top of memory. It is essentially
a hole torn in the physical address space so that you can fit non-memory resources
(e.g. flash) at the top of the 4G address space. Given that this only happens on machines
with lots of memory, the default 4 MB is a very reasonable value.
endmenu

View file

@ -25,5 +25,6 @@ $(obj)/device/%.o: $(src)/device/%.c
$(Q)$(CC) $(INITCFLAGS) -c $< -o $@
STAGE2_DEVICE_SRC = device.c device_util.c root_device.c \
pci_device.c pci_ops.c pci_rom.c pnp_device.c pnp_raw.c
pci_device.c pci_ops.c pci_rom.c pnp_device.c pnp_raw.c \
smbus_ops.c

View file

@ -432,7 +432,7 @@ void compact_resources(struct device *dev)
/* Note: memmove() was used here. But this can never
* overlap, right?
*/
memcpy(resource, resource + 1, dev->resources - i);
memcpy(resource, resource + 1, (dev->resources-i)* sizeof(*resource));
dev->resources -= 1;
memset(&dev->resource[dev->resources], 0,
sizeof(*resource));