Lines Matching refs:mpc
144 static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str) in smp_check_mpc() argument
147 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { in smp_check_mpc()
149 mpc->signature[0], mpc->signature[1], in smp_check_mpc()
150 mpc->signature[2], mpc->signature[3]); in smp_check_mpc()
153 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { in smp_check_mpc()
157 if (mpc->spec != 0x01 && mpc->spec != 0x04) { in smp_check_mpc()
158 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec); in smp_check_mpc()
161 if (!mpc->lapic) { in smp_check_mpc()
165 memcpy(oem, mpc->oem, 8); in smp_check_mpc()
169 memcpy(str, mpc->productid, 12); in smp_check_mpc()
174 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic); in smp_check_mpc()
185 static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) in smp_dump_mptable() argument
190 1, mpc, mpc->length, 1); in smp_dump_mptable()
193 static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) in smp_read_mpc() argument
198 int count = sizeof(*mpc); in smp_read_mpc()
199 unsigned char *mpt = ((unsigned char *)mpc) + count; in smp_read_mpc()
201 if (!smp_check_mpc(mpc, oem, str)) in smp_read_mpc()
206 register_lapic_address(mpc->lapic); in smp_read_mpc()
212 while (count < mpc->length) { in smp_read_mpc()
238 smp_dump_mptable(mpc, mpt); in smp_read_mpc()
239 count = mpc->length; in smp_read_mpc()
423 struct mpc_table *mpc; in get_mpc_size() local
426 mpc = early_memremap(physptr, PAGE_SIZE); in get_mpc_size()
427 size = mpc->length; in get_mpc_size()
428 early_memunmap(mpc, PAGE_SIZE); in get_mpc_size()
436 struct mpc_table *mpc; in check_physptr() local
440 mpc = early_memremap(mpf->physptr, size); in check_physptr()
446 if (!smp_read_mpc(mpc, early)) { in check_physptr()
452 early_memunmap(mpc, size); in check_physptr()
455 early_memunmap(mpc, size); in check_physptr()
726 static int __init replace_intsrc_all(struct mpc_table *mpc, in replace_intsrc_all() argument
733 int count = sizeof(*mpc); in replace_intsrc_all()
735 unsigned char *mpt = ((unsigned char *)mpc) + count; in replace_intsrc_all()
737 pr_info("mpc_length %x\n", mpc->length); in replace_intsrc_all()
738 while (count < mpc->length) { in replace_intsrc_all()
758 smp_dump_mptable(mpc, mpt); in replace_intsrc_all()
786 mpc->length = count; in replace_intsrc_all()
794 mpc->checksum = 0; in replace_intsrc_all()
795 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); in replace_intsrc_all()
842 struct mpc_table *mpc, *mpc_new; in update_mp_table() local
867 mpc = early_memremap(mpf->physptr, size); in update_mp_table()
868 if (!mpc) { in update_mp_table()
873 if (!smp_check_mpc(mpc, oem, str)) in update_mp_table()
879 if (mpc_new_phys && mpc->length > mpc_new_length) { in update_mp_table()
888 mpc->checksum = 0; in update_mp_table()
889 old = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
890 mpc->checksum = 0xff; in update_mp_table()
891 new = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
904 memcpy(mpc_new, mpc, mpc->length); in update_mp_table()
905 early_memunmap(mpc, size); in update_mp_table()
906 mpc = mpc_new; in update_mp_table()
934 replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length); in update_mp_table()
937 early_memunmap(mpc, size); in update_mp_table()