Lines Matching refs:mpc

139 static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)  in smp_check_mpc()  argument
142 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { in smp_check_mpc()
144 mpc->signature[0], mpc->signature[1], in smp_check_mpc()
145 mpc->signature[2], mpc->signature[3]); in smp_check_mpc()
148 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { in smp_check_mpc()
152 if (mpc->spec != 0x01 && mpc->spec != 0x04) { in smp_check_mpc()
153 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec); in smp_check_mpc()
156 if (!mpc->lapic) { in smp_check_mpc()
160 memcpy(oem, mpc->oem, 8); in smp_check_mpc()
164 memcpy(str, mpc->productid, 12); in smp_check_mpc()
169 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic); in smp_check_mpc()
180 static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) in smp_dump_mptable() argument
185 1, mpc, mpc->length, 1); in smp_dump_mptable()
188 static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) in smp_read_mpc() argument
193 int count = sizeof(*mpc); in smp_read_mpc()
194 unsigned char *mpt = ((unsigned char *)mpc) + count; in smp_read_mpc()
196 if (!smp_check_mpc(mpc, oem, str)) in smp_read_mpc()
201 register_lapic_address(mpc->lapic); in smp_read_mpc()
207 while (count < mpc->length) { in smp_read_mpc()
233 smp_dump_mptable(mpc, mpt); in smp_read_mpc()
234 count = mpc->length; in smp_read_mpc()
413 struct mpc_table *mpc; in get_mpc_size() local
416 mpc = early_memremap(physptr, PAGE_SIZE); in get_mpc_size()
417 size = mpc->length; in get_mpc_size()
418 early_memunmap(mpc, PAGE_SIZE); in get_mpc_size()
426 struct mpc_table *mpc; in check_physptr() local
430 mpc = early_memremap(mpf->physptr, size); in check_physptr()
436 if (!smp_read_mpc(mpc, early)) { in check_physptr()
442 early_memunmap(mpc, size); in check_physptr()
445 early_memunmap(mpc, size); in check_physptr()
714 static int __init replace_intsrc_all(struct mpc_table *mpc, in replace_intsrc_all() argument
721 int count = sizeof(*mpc); in replace_intsrc_all()
723 unsigned char *mpt = ((unsigned char *)mpc) + count; in replace_intsrc_all()
725 pr_info("mpc_length %x\n", mpc->length); in replace_intsrc_all()
726 while (count < mpc->length) { in replace_intsrc_all()
746 smp_dump_mptable(mpc, mpt); in replace_intsrc_all()
774 mpc->length = count; in replace_intsrc_all()
782 mpc->checksum = 0; in replace_intsrc_all()
783 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); in replace_intsrc_all()
830 struct mpc_table *mpc, *mpc_new; in update_mp_table() local
855 mpc = early_memremap(mpf->physptr, size); in update_mp_table()
856 if (!mpc) { in update_mp_table()
861 if (!smp_check_mpc(mpc, oem, str)) in update_mp_table()
867 if (mpc_new_phys && mpc->length > mpc_new_length) { in update_mp_table()
876 mpc->checksum = 0; in update_mp_table()
877 old = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
878 mpc->checksum = 0xff; in update_mp_table()
879 new = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
892 memcpy(mpc_new, mpc, mpc->length); in update_mp_table()
893 early_memunmap(mpc, size); in update_mp_table()
894 mpc = mpc_new; in update_mp_table()
922 replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length); in update_mp_table()
925 early_memunmap(mpc, size); in update_mp_table()