aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/microcode_amd.c
diff options
context:
space:
mode:
authorPeter Oruba <peter.oruba@amd.com>2008-09-17 09:39:18 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-23 10:13:01 -0400
commitd4738792fb86600b6cb7220459d9c47e819b3580 (patch)
tree1e301cf4941565da15f61b19e168cb8e8af2dac3 /arch/x86/kernel/microcode_amd.c
parentb6cffde1a20409f9720d5c9aba28d3efd3a4f04e (diff)
x86, microcode rework, v2, renaming cont.
Renaming based on patch from Dmitry Adamushko. Further clarification by renaming define and variable related to microcode container file. Signed-off-by: Peter Oruba <peter.oruba@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/microcode_amd.c')
-rw-r--r--arch/x86/kernel/microcode_amd.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 62058e9c8b4e..829415208ff8 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -263,21 +263,20 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
263 unsigned int *mc_size) 263 unsigned int *mc_size)
264{ 264{
265 unsigned int total_size; 265 unsigned int total_size;
266#define UCODE_UNKNOWN_HDR 8 266#define UCODE_CONTAINER_SECTION_HDR 8
267 u8 hdr[UCODE_UNKNOWN_HDR]; 267 u8 section_hdr[UCODE_CONTAINER_SECTION_HDR];
268 void *mc; 268 void *mc;
269 269
270 if (get_ucode_data(hdr, buf, UCODE_UNKNOWN_HDR)) 270 if (get_ucode_data(section_hdr, buf, UCODE_CONTAINER_SECTION_HDR))
271 return NULL; 271 return NULL;
272 272
273 if (hdr[0] != UCODE_UCODE_TYPE) { 273 if (section_hdr[0] != UCODE_UCODE_TYPE) {
274 printk(KERN_ERR "microcode: error! " 274 printk(KERN_ERR "microcode: error! "
275 "Wrong microcode payload type field\n"); 275 "Wrong microcode payload type field\n");
276 return NULL; 276 return NULL;
277 } 277 }
278 278
279 /* FIXME! dimm: Why not by means of get_totalsize(hdr)? */ 279 total_size = (unsigned long) (section_hdr[4] + (section_hdr[5] << 8));
280 total_size = (unsigned long) (hdr[4] + (hdr[5] << 8));
281 280
282 printk(KERN_INFO "microcode: size %u, total_size %u\n", 281 printk(KERN_INFO "microcode: size %u, total_size %u\n",
283 size, total_size); 282 size, total_size);
@@ -290,13 +289,13 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
290 mc = vmalloc(UCODE_MAX_SIZE); 289 mc = vmalloc(UCODE_MAX_SIZE);
291 if (mc) { 290 if (mc) {
292 memset(mc, 0, UCODE_MAX_SIZE); 291 memset(mc, 0, UCODE_MAX_SIZE);
293 if (get_ucode_data(mc, buf + UCODE_UNKNOWN_HDR, total_size)) { 292 if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR, total_size)) {
294 vfree(mc); 293 vfree(mc);
295 mc = NULL; 294 mc = NULL;
296 } else 295 } else
297 *mc_size = total_size + UCODE_UNKNOWN_HDR; 296 *mc_size = total_size + UCODE_CONTAINER_SECTION_HDR;
298 } 297 }
299#undef UCODE_UNKNOWN_HDR 298#undef UCODE_CONTAINER_SECTION_HDR
300 return mc; 299 return mc;
301} 300}
302 301