Lines Matching refs:mpc

157 static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)  in smp_check_mpc()  argument
160 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { in smp_check_mpc()
162 mpc->signature[0], mpc->signature[1], in smp_check_mpc()
163 mpc->signature[2], mpc->signature[3]); in smp_check_mpc()
166 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { in smp_check_mpc()
170 if (mpc->spec != 0x01 && mpc->spec != 0x04) { in smp_check_mpc()
171 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec); in smp_check_mpc()
174 if (!mpc->lapic) { in smp_check_mpc()
178 memcpy(oem, mpc->oem, 8); in smp_check_mpc()
182 memcpy(str, mpc->productid, 12); in smp_check_mpc()
187 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic); in smp_check_mpc()
198 static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) in smp_dump_mptable() argument
203 1, mpc, mpc->length, 1); in smp_dump_mptable()
206 void __init default_smp_read_mpc_oem(struct mpc_table *mpc) { } in default_smp_read_mpc_oem() argument
208 static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) in smp_read_mpc() argument
213 int count = sizeof(*mpc); in smp_read_mpc()
214 unsigned char *mpt = ((unsigned char *)mpc) + count; in smp_read_mpc()
216 if (!smp_check_mpc(mpc, oem, str)) in smp_read_mpc()
221 register_lapic_address(mpc->lapic); in smp_read_mpc()
226 if (mpc->oemptr) in smp_read_mpc()
227 x86_init.mpparse.smp_read_mpc_oem(mpc); in smp_read_mpc()
234 while (count < mpc->length) { in smp_read_mpc()
260 smp_dump_mptable(mpc, mpt); in smp_read_mpc()
261 count = mpc->length; in smp_read_mpc()
442 struct mpc_table *mpc; in get_mpc_size() local
445 mpc = early_ioremap(physptr, PAGE_SIZE); in get_mpc_size()
446 size = mpc->length; in get_mpc_size()
447 early_iounmap(mpc, PAGE_SIZE); in get_mpc_size()
455 struct mpc_table *mpc; in check_physptr() local
459 mpc = early_ioremap(mpf->physptr, size); in check_physptr()
464 if (!smp_read_mpc(mpc, early)) { in check_physptr()
470 early_iounmap(mpc, size); in check_physptr()
473 early_iounmap(mpc, size); in check_physptr()
728 static int __init replace_intsrc_all(struct mpc_table *mpc, in replace_intsrc_all() argument
735 int count = sizeof(*mpc); in replace_intsrc_all()
737 unsigned char *mpt = ((unsigned char *)mpc) + count; in replace_intsrc_all()
739 pr_info("mpc_length %x\n", mpc->length); in replace_intsrc_all()
740 while (count < mpc->length) { in replace_intsrc_all()
760 smp_dump_mptable(mpc, mpt); in replace_intsrc_all()
787 mpc->length = count; in replace_intsrc_all()
795 mpc->checksum = 0; in replace_intsrc_all()
796 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); in replace_intsrc_all()
843 struct mpc_table *mpc, *mpc_new; in update_mp_table() local
861 mpc = phys_to_virt(mpf->physptr); in update_mp_table()
863 if (!smp_check_mpc(mpc, oem, str)) in update_mp_table()
869 if (mpc_new_phys && mpc->length > mpc_new_length) { in update_mp_table()
878 mpc->checksum = 0; in update_mp_table()
879 old = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
880 mpc->checksum = 0xff; in update_mp_table()
881 new = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
890 memcpy(mpc_new, mpc, mpc->length); in update_mp_table()
891 mpc = mpc_new; in update_mp_table()
913 replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length); in update_mp_table()