s390/mm: shorten addressing mode initialization
Shorten the code for addressing mode initialization. Also add missing __init annotations, since this code is only used during kernel initialization. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
d1b0d842c4
commit
bad4c9c82d
|
@ -305,7 +305,7 @@ early_param("vmalloc", parse_vmalloc);
|
||||||
unsigned int s390_user_mode = PRIMARY_SPACE_MODE;
|
unsigned int s390_user_mode = PRIMARY_SPACE_MODE;
|
||||||
EXPORT_SYMBOL_GPL(s390_user_mode);
|
EXPORT_SYMBOL_GPL(s390_user_mode);
|
||||||
|
|
||||||
static int set_amode_primary(void)
|
static void __init set_user_mode_primary(void)
|
||||||
{
|
{
|
||||||
psw_kernel_bits = (psw_kernel_bits & ~PSW_MASK_ASC) | PSW_ASC_HOME;
|
psw_kernel_bits = (psw_kernel_bits & ~PSW_MASK_ASC) | PSW_ASC_HOME;
|
||||||
psw_user_bits = (psw_user_bits & ~PSW_MASK_ASC) | PSW_ASC_PRIMARY;
|
psw_user_bits = (psw_user_bits & ~PSW_MASK_ASC) | PSW_ASC_PRIMARY;
|
||||||
|
@ -313,14 +313,7 @@ static int set_amode_primary(void)
|
||||||
psw32_user_bits =
|
psw32_user_bits =
|
||||||
(psw32_user_bits & ~PSW32_MASK_ASC) | PSW32_ASC_PRIMARY;
|
(psw32_user_bits & ~PSW32_MASK_ASC) | PSW32_ASC_PRIMARY;
|
||||||
#endif
|
#endif
|
||||||
|
uaccess = MACHINE_HAS_MVCOS ? uaccess_mvcos_switch : uaccess_pt;
|
||||||
if (MACHINE_HAS_MVCOS) {
|
|
||||||
memcpy(&uaccess, &uaccess_mvcos_switch, sizeof(uaccess));
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
memcpy(&uaccess, &uaccess_pt, sizeof(uaccess));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init early_parse_user_mode(char *p)
|
static int __init early_parse_user_mode(char *p)
|
||||||
|
@ -335,16 +328,15 @@ static int __init early_parse_user_mode(char *p)
|
||||||
}
|
}
|
||||||
early_param("user_mode", early_parse_user_mode);
|
early_param("user_mode", early_parse_user_mode);
|
||||||
|
|
||||||
static void setup_addressing_mode(void)
|
static void __init setup_addressing_mode(void)
|
||||||
{
|
{
|
||||||
if (s390_user_mode == PRIMARY_SPACE_MODE) {
|
if (s390_user_mode != PRIMARY_SPACE_MODE)
|
||||||
if (set_amode_primary())
|
return;
|
||||||
pr_info("Address spaces switched, "
|
set_user_mode_primary();
|
||||||
"mvcos available\n");
|
if (MACHINE_HAS_MVCOS)
|
||||||
else
|
pr_info("Address spaces switched, mvcos available\n");
|
||||||
pr_info("Address spaces switched, "
|
else
|
||||||
"mvcos not available\n");
|
pr_info("Address spaces switched, mvcos not available\n");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *restart_stack __attribute__((__section__(".data")));
|
void *restart_stack __attribute__((__section__(".data")));
|
||||||
|
|
Loading…
Reference in New Issue