mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
MIPS: Retrieve ASID masks using function accepting struct cpuinfo_mips
In preparation for supporting variable ASID masks, retrieve ASID masks using functions in asm/cpu-info.h which accept struct cpuinfo_mips. This will allow those functions to determine the ASID mask based upon the CPU in a later patch. This also allows for the r3k & r8k cases to be handled in Kconfig, which is arguably cleaner than the previous #ifdefs. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: linux-mips@linux-mips.org Cc: kvm@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/13210/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
committed by
Ralf Baechle
parent
f1b711c638
commit
4edf00a46b
@@ -132,4 +132,14 @@ struct proc_cpuinfo_notifier_args {
|
||||
# define cpu_vpe_id(cpuinfo) ({ (void)cpuinfo; 0; })
|
||||
#endif
|
||||
|
||||
static inline unsigned long cpu_asid_inc(void)
|
||||
{
|
||||
return 1 << CONFIG_MIPS_ASID_SHIFT;
|
||||
}
|
||||
|
||||
static inline unsigned long cpu_asid_mask(struct cpuinfo_mips *cpuinfo)
|
||||
{
|
||||
return ((1 << CONFIG_MIPS_ASID_BITS) - 1) << CONFIG_MIPS_ASID_SHIFT;
|
||||
}
|
||||
|
||||
#endif /* __ASM_CPU_INFO_H */
|
||||
|
||||
Reference in New Issue
Block a user