mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 06:37:59 +00:00
sh: Expose physical addressing mode through cpuinfo.
CPUs can be in either the legacy 29-bit or 32-bit physical addressing modes. This follows the x86 approach of tracking the phys bits in cpuinfo and exposing it to userspace through procfs. This change was requested to permit kexec-tools to detect the physical addressing mode in order to determine the appropriate address mangling. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
b18cae4224
commit
2f98492c53
3 changed files with 6 additions and 0 deletions
|
@ -89,6 +89,7 @@ struct sh_cpuinfo {
|
||||||
struct task_struct *idle;
|
struct task_struct *idle;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
unsigned int phys_bits;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
} __attribute__ ((aligned(L1_CACHE_BYTES)));
|
} __attribute__ ((aligned(L1_CACHE_BYTES)));
|
||||||
|
|
||||||
|
|
|
@ -340,6 +340,8 @@ asmlinkage void __cpuinit cpu_init(void)
|
||||||
*/
|
*/
|
||||||
current_cpu_data.asid_cache = NO_CONTEXT;
|
current_cpu_data.asid_cache = NO_CONTEXT;
|
||||||
|
|
||||||
|
current_cpu_data.phys_bits = __in_29bit_mode() ? 29 : 32;
|
||||||
|
|
||||||
speculative_execution_init();
|
speculative_execution_init();
|
||||||
expmask_init();
|
expmask_init();
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ struct sh_cpuinfo cpu_data[NR_CPUS] __read_mostly = {
|
||||||
.type = CPU_SH_NONE,
|
.type = CPU_SH_NONE,
|
||||||
.family = CPU_FAMILY_UNKNOWN,
|
.family = CPU_FAMILY_UNKNOWN,
|
||||||
.loops_per_jiffy = 10000000,
|
.loops_per_jiffy = 10000000,
|
||||||
|
.phys_bits = MAX_PHYSMEM_BITS,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
EXPORT_SYMBOL(cpu_data);
|
EXPORT_SYMBOL(cpu_data);
|
||||||
|
@ -432,6 +433,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
||||||
if (c->flags & CPU_HAS_L2_CACHE)
|
if (c->flags & CPU_HAS_L2_CACHE)
|
||||||
show_cacheinfo(m, "scache", c->scache);
|
show_cacheinfo(m, "scache", c->scache);
|
||||||
|
|
||||||
|
seq_printf(m, "address sizes\t: %u bits physical\n", c->phys_bits);
|
||||||
|
|
||||||
seq_printf(m, "bogomips\t: %lu.%02lu\n",
|
seq_printf(m, "bogomips\t: %lu.%02lu\n",
|
||||||
c->loops_per_jiffy/(500000/HZ),
|
c->loops_per_jiffy/(500000/HZ),
|
||||||
(c->loops_per_jiffy/(5000/HZ)) % 100);
|
(c->loops_per_jiffy/(5000/HZ)) % 100);
|
||||||
|
|
Loading…
Add table
Reference in a new issue