Lines Matching refs:mpc
143 static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str) in smp_check_mpc() argument
146 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { in smp_check_mpc()
148 mpc->signature[0], mpc->signature[1], in smp_check_mpc()
149 mpc->signature[2], mpc->signature[3]); in smp_check_mpc()
152 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { in smp_check_mpc()
156 if (mpc->spec != 0x01 && mpc->spec != 0x04) { in smp_check_mpc()
157 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec); in smp_check_mpc()
160 if (!mpc->lapic) { in smp_check_mpc()
164 memcpy(oem, mpc->oem, 8); in smp_check_mpc()
168 memcpy(str, mpc->productid, 12); in smp_check_mpc()
173 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic); in smp_check_mpc()
184 static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) in smp_dump_mptable() argument
189 1, mpc, mpc->length, 1); in smp_dump_mptable()
192 static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) in smp_read_mpc() argument
197 int count = sizeof(*mpc); in smp_read_mpc()
198 unsigned char *mpt = ((unsigned char *)mpc) + count; in smp_read_mpc()
200 if (!smp_check_mpc(mpc, oem, str)) in smp_read_mpc()
205 register_lapic_address(mpc->lapic); in smp_read_mpc()
211 while (count < mpc->length) { in smp_read_mpc()
237 smp_dump_mptable(mpc, mpt); in smp_read_mpc()
238 count = mpc->length; in smp_read_mpc()
422 struct mpc_table *mpc; in get_mpc_size() local
425 mpc = early_memremap(physptr, PAGE_SIZE); in get_mpc_size()
426 size = mpc->length; in get_mpc_size()
427 early_memunmap(mpc, PAGE_SIZE); in get_mpc_size()
435 struct mpc_table *mpc; in check_physptr() local
439 mpc = early_memremap(mpf->physptr, size); in check_physptr()
445 if (!smp_read_mpc(mpc, early)) { in check_physptr()
451 early_memunmap(mpc, size); in check_physptr()
454 early_memunmap(mpc, size); in check_physptr()
725 static int __init replace_intsrc_all(struct mpc_table *mpc, in replace_intsrc_all() argument
732 int count = sizeof(*mpc); in replace_intsrc_all()
734 unsigned char *mpt = ((unsigned char *)mpc) + count; in replace_intsrc_all()
736 pr_info("mpc_length %x\n", mpc->length); in replace_intsrc_all()
737 while (count < mpc->length) { in replace_intsrc_all()
757 smp_dump_mptable(mpc, mpt); in replace_intsrc_all()
785 mpc->length = count; in replace_intsrc_all()
793 mpc->checksum = 0; in replace_intsrc_all()
794 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); in replace_intsrc_all()
841 struct mpc_table *mpc, *mpc_new; in update_mp_table() local
866 mpc = early_memremap(mpf->physptr, size); in update_mp_table()
867 if (!mpc) { in update_mp_table()
872 if (!smp_check_mpc(mpc, oem, str)) in update_mp_table()
878 if (mpc_new_phys && mpc->length > mpc_new_length) { in update_mp_table()
887 mpc->checksum = 0; in update_mp_table()
888 old = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
889 mpc->checksum = 0xff; in update_mp_table()
890 new = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
903 memcpy(mpc_new, mpc, mpc->length); in update_mp_table()
904 early_memunmap(mpc, size); in update_mp_table()
905 mpc = mpc_new; in update_mp_table()
933 replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length); in update_mp_table()
936 early_memunmap(mpc, size); in update_mp_table()