summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Smith <joe@settoplinux.org>2010-05-27 22:47:13 +0000
committerStefan Reinauer <stepan@openbios.org>2010-05-27 22:47:13 +0000
commit7b2e2b99661bc15a8722ed30e02ab872a4b1c976 (patch)
tree7ee33f69c7bed0919f86662e2878c1c411c22d75
parentc56e5ad7254ddf7ee9f1f016150de9e28c3ff57e (diff)
downloadcoreboot-7b2e2b99661bc15a8722ed30e02ab872a4b1c976.tar.xz
Fix MBI walker.
Signed-off-by: Joseph Smith <joe@settoplinux.org> Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Joseph Smith <joe@settoplinux.org> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5595 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--src/northbridge/intel/i82830/i82830_smihandler.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/northbridge/intel/i82830/i82830_smihandler.c b/src/northbridge/intel/i82830/i82830_smihandler.c
index cf5840296a..852c764608 100644
--- a/src/northbridge/intel/i82830/i82830_smihandler.c
+++ b/src/northbridge/intel/i82830/i82830_smihandler.c
@@ -196,7 +196,7 @@ static void mbi_call(u8 subf, banner_id_t *banner_id)
}
mbi_header = (mbi_header_t *)&mbi[i];
- len = ALIGN((mbi_header->size * 16) + sizeof(mbi_header) + mbi_header->name_len, 16);
+ len = ALIGN((mbi_header->size * 16) + sizeof(mbi_header) + ALIGN(mbi_header->name_len, 16), 16);
if (obj_header->objnum == count) {
#ifdef DEBUG_SMI_I82830
@@ -205,7 +205,7 @@ static void mbi_call(u8 subf, banner_id_t *banner_id)
break;
}
#endif
- int headerlen = ALIGN(sizeof(mbi_header) + mbi_header->name_len + 15, 16);
+ int headerlen = ALIGN(sizeof(mbi_header) + ALIGN(mbi_header->name_len, 16), 16);
#ifdef DEBUG_SMI_I82830
printk(BIOS_DEBUG, "| |- headerlen = %d\n", headerlen);
#endif
@@ -245,7 +245,7 @@ static void mbi_call(u8 subf, banner_id_t *banner_id)
getobj->banner.retsts = MSH_IF_NOT_FOUND;
for (i=0; i< mbi_len;) {
- int len;
+ int headerlen, objectlen;
if (!(mbi[i] == 0xf0 && mbi [i+1] == 0xf6)) {
i+=16;
@@ -253,21 +253,23 @@ static void mbi_call(u8 subf, banner_id_t *banner_id)
}
mbi_header = (mbi_header_t *)&mbi[i];
- len = ALIGN((mbi_header->size * 16) + sizeof(mbi_header) + mbi_header->name_len, 16);
+ headerlen = ALIGN(sizeof(mbi_header) + ALIGN(mbi_header->name_len, 16), 16);
+ objectlen = ALIGN((mbi_header->size * 16), 16);
if (getobj->objnum == count) {
- printk(BIOS_DEBUG, "| |- len = %x\n", len);
+ printk(BIOS_DEBUG, "| |- len = %x\n", headerlen + objectlen);
+
memcpy((void *)(getobj->buffer + OBJ_OFFSET),
- ((char *)mbi_header) + 0x20 , (len > getobj->buflen) ? getobj->buflen : len);
+ ((char *)mbi_header) + headerlen, (objectlen > getobj->buflen) ? getobj->buflen : objectlen);
getobj->banner.retsts = MSH_OK;
#ifdef DEBUG_SMI_I82830
dump((u8 *)banner_id, sizeof(*getobj));
- dump((u8 *)getobj->buffer + OBJ_OFFSET, len);
+ dump((u8 *)getobj->buffer + OBJ_OFFSET, objectlen);
#endif
break;
}
- i += len;
+ i += (headerlen + objectlen);
count++;
}
if (getobj->banner.retsts == MSH_IF_NOT_FOUND)