Lines Matching refs:mpc
140 static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str) in smp_check_mpc() argument
143 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { in smp_check_mpc()
145 mpc->signature[0], mpc->signature[1], in smp_check_mpc()
146 mpc->signature[2], mpc->signature[3]); in smp_check_mpc()
149 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { in smp_check_mpc()
153 if (mpc->spec != 0x01 && mpc->spec != 0x04) { in smp_check_mpc()
154 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec); in smp_check_mpc()
157 if (!mpc->lapic) { in smp_check_mpc()
161 memcpy(oem, mpc->oem, 8); in smp_check_mpc()
165 memcpy(str, mpc->productid, 12); in smp_check_mpc()
170 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic); in smp_check_mpc()
181 static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) in smp_dump_mptable() argument
186 1, mpc, mpc->length, 1); in smp_dump_mptable()
189 static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) in smp_read_mpc() argument
194 int count = sizeof(*mpc); in smp_read_mpc()
195 unsigned char *mpt = ((unsigned char *)mpc) + count; in smp_read_mpc()
197 if (!smp_check_mpc(mpc, oem, str)) in smp_read_mpc()
203 register_lapic_address(mpc->lapic); in smp_read_mpc()
208 while (count < mpc->length) { in smp_read_mpc()
234 smp_dump_mptable(mpc, mpt); in smp_read_mpc()
235 count = mpc->length; in smp_read_mpc()
414 struct mpc_table *mpc; in get_mpc_size() local
417 mpc = early_memremap(physptr, PAGE_SIZE); in get_mpc_size()
418 size = mpc->length; in get_mpc_size()
419 early_memunmap(mpc, PAGE_SIZE); in get_mpc_size()
427 struct mpc_table *mpc; in check_physptr() local
431 mpc = early_memremap(mpf->physptr, size); in check_physptr()
437 if (!smp_read_mpc(mpc, early)) { in check_physptr()
443 early_memunmap(mpc, size); in check_physptr()
446 early_memunmap(mpc, size); in check_physptr()
724 static int __init replace_intsrc_all(struct mpc_table *mpc, in replace_intsrc_all() argument
731 int count = sizeof(*mpc); in replace_intsrc_all()
733 unsigned char *mpt = ((unsigned char *)mpc) + count; in replace_intsrc_all()
735 pr_info("mpc_length %x\n", mpc->length); in replace_intsrc_all()
736 while (count < mpc->length) { in replace_intsrc_all()
756 smp_dump_mptable(mpc, mpt); in replace_intsrc_all()
784 mpc->length = count; in replace_intsrc_all()
792 mpc->checksum = 0; in replace_intsrc_all()
793 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); in replace_intsrc_all()
840 struct mpc_table *mpc, *mpc_new; in update_mp_table() local
865 mpc = early_memremap(mpf->physptr, size); in update_mp_table()
866 if (!mpc) { in update_mp_table()
871 if (!smp_check_mpc(mpc, oem, str)) in update_mp_table()
877 if (mpc_new_phys && mpc->length > mpc_new_length) { in update_mp_table()
886 mpc->checksum = 0; in update_mp_table()
887 old = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
888 mpc->checksum = 0xff; in update_mp_table()
889 new = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
902 memcpy(mpc_new, mpc, mpc->length); in update_mp_table()
903 early_memunmap(mpc, size); in update_mp_table()
904 mpc = mpc_new; in update_mp_table()
932 replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length); in update_mp_table()
935 early_memunmap(mpc, size); in update_mp_table()