summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-12-16 07:19:09 +0200
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2015-02-03 04:52:12 +0100
commit1608f3651f79d4b9136b020b74d29632262e896a (patch)
treedbfca55c5ff4b3c87de61e07cffb2d179f94ffaa /src
parentd15cb519ad036060ec5ebcca8de861de07fe932a (diff)
downloadcoreboot-1608f3651f79d4b9136b020b74d29632262e896a.tar.xz
cpu/amd (non-AGESA): Remove terminator from microcode blob
Change-Id: I6370e971922dee5e8d476a883c5f0f32fbbc8911 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/4534 Tested-by: build bot (Jenkins) Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Diffstat (limited to 'src')
-rw-r--r--src/cpu/amd/microcode/microcode.c6
-rw-r--r--src/cpu/amd/model_10xxx/microcode_blob.c6
-rw-r--r--src/cpu/amd/model_fxx/microcode_blob.c6
3 files changed, 4 insertions, 14 deletions
diff --git a/src/cpu/amd/microcode/microcode.c b/src/cpu/amd/microcode/microcode.c
index a5da75b74c..938f5f697a 100644
--- a/src/cpu/amd/microcode/microcode.c
+++ b/src/cpu/amd/microcode/microcode.c
@@ -80,9 +80,11 @@ static void amd_update_microcode(const void *ucode, size_t ucode_len,
uint32_t equivalent_processor_rev_id)
{
const struct microcode *m;
- const void *c;
+ const uint8_t *c = ucode;
+ const uint8_t *ucode_end = (uint8_t*)ucode + ucode_len;
- for(m = c = ucode; m->date_code; m = c) {
+ while (c <= (ucode_end - 2048)) {
+ m = (struct microcode *)c;
if (m->processor_rev_id == equivalent_processor_rev_id) {
apply_microcode_patch(m);
break;
diff --git a/src/cpu/amd/model_10xxx/microcode_blob.c b/src/cpu/amd/model_10xxx/microcode_blob.c
index c2f93b50d7..524c48477e 100644
--- a/src/cpu/amd/model_10xxx/microcode_blob.c
+++ b/src/cpu/amd/model_10xxx/microcode_blob.c
@@ -6,10 +6,4 @@ unsigned char microcode[] __attribute__ ((aligned(16))) = {
#include "mc_patch_010000b6.h"
#include "mc_patch_010000bf.h"
#include "mc_patch_010000c4.h"
-
- /* Dummy terminator */
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
};
diff --git a/src/cpu/amd/model_fxx/microcode_blob.c b/src/cpu/amd/model_fxx/microcode_blob.c
index 1b6b979cd4..ad6e3ca01a 100644
--- a/src/cpu/amd/model_fxx/microcode_blob.c
+++ b/src/cpu/amd/model_fxx/microcode_blob.c
@@ -4,10 +4,4 @@ unsigned char microcode[] __attribute__ ((aligned(16))) = {
#include "microcode_rev_d.h"
#include "microcode_rev_e.h"
#endif
-
- /* Dummy terminator */
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
};