Lines Matching refs:mpc
151 static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str) in smp_check_mpc() argument
154 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { in smp_check_mpc()
156 mpc->signature[0], mpc->signature[1], in smp_check_mpc()
157 mpc->signature[2], mpc->signature[3]); in smp_check_mpc()
160 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { in smp_check_mpc()
164 if (mpc->spec != 0x01 && mpc->spec != 0x04) { in smp_check_mpc()
165 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec); in smp_check_mpc()
168 if (!mpc->lapic) { in smp_check_mpc()
172 memcpy(oem, mpc->oem, 8); in smp_check_mpc()
176 memcpy(str, mpc->productid, 12); in smp_check_mpc()
181 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic); in smp_check_mpc()
192 static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) in smp_dump_mptable() argument
197 1, mpc, mpc->length, 1); in smp_dump_mptable()
200 void __init default_smp_read_mpc_oem(struct mpc_table *mpc) { } in default_smp_read_mpc_oem() argument
202 static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) in smp_read_mpc() argument
207 int count = sizeof(*mpc); in smp_read_mpc()
208 unsigned char *mpt = ((unsigned char *)mpc) + count; in smp_read_mpc()
210 if (!smp_check_mpc(mpc, oem, str)) in smp_read_mpc()
215 register_lapic_address(mpc->lapic); in smp_read_mpc()
220 if (mpc->oemptr) in smp_read_mpc()
221 x86_init.mpparse.smp_read_mpc_oem(mpc); in smp_read_mpc()
228 while (count < mpc->length) { in smp_read_mpc()
254 smp_dump_mptable(mpc, mpt); in smp_read_mpc()
255 count = mpc->length; in smp_read_mpc()
440 struct mpc_table *mpc; in get_mpc_size() local
443 mpc = early_memremap(physptr, PAGE_SIZE); in get_mpc_size()
444 size = mpc->length; in get_mpc_size()
445 early_memunmap(mpc, PAGE_SIZE); in get_mpc_size()
453 struct mpc_table *mpc; in check_physptr() local
457 mpc = early_memremap(mpf->physptr, size); in check_physptr()
463 if (!smp_read_mpc(mpc, early)) { in check_physptr()
469 early_memunmap(mpc, size); in check_physptr()
472 early_memunmap(mpc, size); in check_physptr()
743 static int __init replace_intsrc_all(struct mpc_table *mpc, in replace_intsrc_all() argument
750 int count = sizeof(*mpc); in replace_intsrc_all()
752 unsigned char *mpt = ((unsigned char *)mpc) + count; in replace_intsrc_all()
754 pr_info("mpc_length %x\n", mpc->length); in replace_intsrc_all()
755 while (count < mpc->length) { in replace_intsrc_all()
775 smp_dump_mptable(mpc, mpt); in replace_intsrc_all()
803 mpc->length = count; in replace_intsrc_all()
811 mpc->checksum = 0; in replace_intsrc_all()
812 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); in replace_intsrc_all()
859 struct mpc_table *mpc, *mpc_new; in update_mp_table() local
884 mpc = early_memremap(mpf->physptr, size); in update_mp_table()
885 if (!mpc) { in update_mp_table()
890 if (!smp_check_mpc(mpc, oem, str)) in update_mp_table()
896 if (mpc_new_phys && mpc->length > mpc_new_length) { in update_mp_table()
905 mpc->checksum = 0; in update_mp_table()
906 old = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
907 mpc->checksum = 0xff; in update_mp_table()
908 new = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
921 memcpy(mpc_new, mpc, mpc->length); in update_mp_table()
922 early_memunmap(mpc, size); in update_mp_table()
923 mpc = mpc_new; in update_mp_table()
951 replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length); in update_mp_table()
954 early_memunmap(mpc, size); in update_mp_table()