Lines Matching refs:mc

75 #define get_totalsize(mc) \  argument
76 (((struct microcode_intel *)mc)->hdr.totalsize ? \
77 ((struct microcode_intel *)mc)->hdr.totalsize : \
80 #define get_datasize(mc) \ argument
81 (((struct microcode_intel *)mc)->hdr.datasize ? \
82 ((struct microcode_intel *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE)
140 static int microcode_sanity_check(void *mc) in microcode_sanity_check() argument
142 struct microcode_header_intel *mc_header = mc; in microcode_sanity_check()
174 ext_header = mc + MC_HEADER_SIZE + data_size; in microcode_sanity_check()
205 orig_sum += ((uint32_t *)mc)[i]; in microcode_sanity_check()
235 static int get_matching_microcode(const void *mc, unsigned int cpu) in get_matching_microcode() argument
238 const struct microcode_header_intel *mc_header = mc; in get_matching_microcode()
252 ext_header = mc + get_datasize(mc_header) + MC_HEADER_SIZE; in get_matching_microcode()
274 memcpy(new_mc, mc, total_size); in get_matching_microcode()
275 xfree(uci->mc.mc_intel); in get_matching_microcode()
276 uci->mc.mc_intel = new_mc; in get_matching_microcode()
291 if ( uci->mc.mc_intel == NULL ) in apply_microcode()
298 wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)uci->mc.mc_intel->bits); in apply_microcode()
309 if ( val[1] != uci->mc.mc_intel->hdr.rev ) in apply_microcode()
318 uci->mc.mc_intel->hdr.date & 0xffff, in apply_microcode()
319 uci->mc.mc_intel->hdr.date >> 24, in apply_microcode()
320 (uci->mc.mc_intel->hdr.date >> 16) & 0xff); in apply_microcode()
326 static long get_next_ucode_from_buffer(void **mc, const u8 *buf, in get_next_ucode_from_buffer() argument
344 *mc = xmalloc_bytes(total_size); in get_next_ucode_from_buffer()
345 if ( *mc == NULL ) in get_next_ucode_from_buffer()
350 memcpy(*mc, (const void *)(buf + offset), total_size); in get_next_ucode_from_buffer()
359 void *mc; in cpu_request_microcode() local
365 while ( (offset = get_next_ucode_from_buffer(&mc, buf, size, offset)) > 0 ) in cpu_request_microcode()
367 error = microcode_sanity_check(mc); in cpu_request_microcode()
370 error = get_matching_microcode(mc, cpu); in cpu_request_microcode()
382 xfree(mc); in cpu_request_microcode()
385 xfree(mc); in cpu_request_microcode()
395 static int microcode_resume_match(unsigned int cpu, const void *mc) in microcode_resume_match() argument
397 return get_matching_microcode(mc, cpu); in microcode_resume_match()