Lines Matching refs:mpc

152 static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)  in smp_check_mpc()  argument
155 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { in smp_check_mpc()
157 mpc->signature[0], mpc->signature[1], in smp_check_mpc()
158 mpc->signature[2], mpc->signature[3]); in smp_check_mpc()
161 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { in smp_check_mpc()
165 if (mpc->spec != 0x01 && mpc->spec != 0x04) { in smp_check_mpc()
166 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec); in smp_check_mpc()
169 if (!mpc->lapic) { in smp_check_mpc()
173 memcpy(oem, mpc->oem, 8); in smp_check_mpc()
177 memcpy(str, mpc->productid, 12); in smp_check_mpc()
182 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic); in smp_check_mpc()
193 static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) in smp_dump_mptable() argument
198 1, mpc, mpc->length, 1); in smp_dump_mptable()
201 void __init default_smp_read_mpc_oem(struct mpc_table *mpc) { } in default_smp_read_mpc_oem() argument
203 static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) in smp_read_mpc() argument
208 int count = sizeof(*mpc); in smp_read_mpc()
209 unsigned char *mpt = ((unsigned char *)mpc) + count; in smp_read_mpc()
211 if (!smp_check_mpc(mpc, oem, str)) in smp_read_mpc()
216 register_lapic_address(mpc->lapic); in smp_read_mpc()
221 if (mpc->oemptr) in smp_read_mpc()
222 x86_init.mpparse.smp_read_mpc_oem(mpc); in smp_read_mpc()
229 while (count < mpc->length) { in smp_read_mpc()
255 smp_dump_mptable(mpc, mpt); in smp_read_mpc()
256 count = mpc->length; in smp_read_mpc()
437 struct mpc_table *mpc; in get_mpc_size() local
440 mpc = early_ioremap(physptr, PAGE_SIZE); in get_mpc_size()
441 size = mpc->length; in get_mpc_size()
442 early_iounmap(mpc, PAGE_SIZE); in get_mpc_size()
450 struct mpc_table *mpc; in check_physptr() local
454 mpc = early_ioremap(mpf->physptr, size); in check_physptr()
459 if (!smp_read_mpc(mpc, early)) { in check_physptr()
465 early_iounmap(mpc, size); in check_physptr()
468 early_iounmap(mpc, size); in check_physptr()
723 static int __init replace_intsrc_all(struct mpc_table *mpc, in replace_intsrc_all() argument
730 int count = sizeof(*mpc); in replace_intsrc_all()
732 unsigned char *mpt = ((unsigned char *)mpc) + count; in replace_intsrc_all()
734 pr_info("mpc_length %x\n", mpc->length); in replace_intsrc_all()
735 while (count < mpc->length) { in replace_intsrc_all()
755 smp_dump_mptable(mpc, mpt); in replace_intsrc_all()
782 mpc->length = count; in replace_intsrc_all()
790 mpc->checksum = 0; in replace_intsrc_all()
791 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); in replace_intsrc_all()
838 struct mpc_table *mpc, *mpc_new; in update_mp_table() local
856 mpc = phys_to_virt(mpf->physptr); in update_mp_table()
858 if (!smp_check_mpc(mpc, oem, str)) in update_mp_table()
864 if (mpc_new_phys && mpc->length > mpc_new_length) { in update_mp_table()
873 mpc->checksum = 0; in update_mp_table()
874 old = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
875 mpc->checksum = 0xff; in update_mp_table()
876 new = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
885 memcpy(mpc_new, mpc, mpc->length); in update_mp_table()
886 mpc = mpc_new; in update_mp_table()
908 replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length); in update_mp_table()