|
@@ -48,23 +48,12 @@ struct read_info_sccb {
|
|
} __packed __aligned(PAGE_SIZE);
|
|
} __packed __aligned(PAGE_SIZE);
|
|
|
|
|
|
static char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE) __initdata;
|
|
static char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE) __initdata;
|
|
-static unsigned int sclp_con_has_vt220 __initdata;
|
|
|
|
-static unsigned int sclp_con_has_linemode __initdata;
|
|
|
|
-static unsigned long sclp_hsa_size;
|
|
|
|
-static unsigned int sclp_max_cpu;
|
|
|
|
static struct sclp_ipl_info sclp_ipl_info;
|
|
static struct sclp_ipl_info sclp_ipl_info;
|
|
-static unsigned char sclp_siif;
|
|
|
|
-static unsigned char sclp_sigpif;
|
|
|
|
-static u32 sclp_ibc;
|
|
|
|
-static unsigned int sclp_mtid;
|
|
|
|
-static unsigned int sclp_mtid_cp;
|
|
|
|
static unsigned int sclp_mtid_max;
|
|
static unsigned int sclp_mtid_max;
|
|
-static unsigned int sclp_mtid_prev;
|
|
|
|
|
|
|
|
|
|
+struct sclp_info sclp;
|
|
|
|
+EXPORT_SYMBOL(sclp);
|
|
u64 sclp_facilities;
|
|
u64 sclp_facilities;
|
|
-u8 sclp_fac84;
|
|
|
|
-unsigned long long sclp_rzm;
|
|
|
|
-unsigned long long sclp_rnmax;
|
|
|
|
|
|
|
|
static int __init sclp_cmd_sync_early(sclp_cmdw_t cmd, void *sccb)
|
|
static int __init sclp_cmd_sync_early(sclp_cmdw_t cmd, void *sccb)
|
|
{
|
|
{
|
|
@@ -118,21 +107,22 @@ static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
|
|
return;
|
|
return;
|
|
|
|
|
|
sclp_facilities = sccb->facilities;
|
|
sclp_facilities = sccb->facilities;
|
|
- sclp_fac84 = sccb->fac84;
|
|
|
|
|
|
+ sclp.has_sprp = !!(sccb->fac84 & 0x02);
|
|
|
|
+ sclp.has_cpu_type = !!(sccb->fac84 & 0x01);
|
|
if (sccb->fac85 & 0x02)
|
|
if (sccb->fac85 & 0x02)
|
|
S390_lowcore.machine_flags |= MACHINE_FLAG_ESOP;
|
|
S390_lowcore.machine_flags |= MACHINE_FLAG_ESOP;
|
|
- sclp_rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2;
|
|
|
|
- sclp_rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2;
|
|
|
|
- sclp_rzm <<= 20;
|
|
|
|
- sclp_ibc = sccb->ibc;
|
|
|
|
|
|
+ sclp.rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2;
|
|
|
|
+ sclp.rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2;
|
|
|
|
+ sclp.rzm <<= 20;
|
|
|
|
+ sclp.ibc = sccb->ibc;
|
|
|
|
|
|
if (!sccb->hcpua) {
|
|
if (!sccb->hcpua) {
|
|
if (MACHINE_IS_VM)
|
|
if (MACHINE_IS_VM)
|
|
- sclp_max_cpu = 64;
|
|
|
|
|
|
+ sclp.max_cpu = 64;
|
|
else
|
|
else
|
|
- sclp_max_cpu = sccb->ncpurl;
|
|
|
|
|
|
+ sclp.max_cpu = sccb->ncpurl;
|
|
} else {
|
|
} else {
|
|
- sclp_max_cpu = sccb->hcpua + 1;
|
|
|
|
|
|
+ sclp.max_cpu = sccb->hcpua + 1;
|
|
}
|
|
}
|
|
|
|
|
|
boot_cpu_address = stap();
|
|
boot_cpu_address = stap();
|
|
@@ -140,8 +130,8 @@ static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
|
|
for (cpu = 0; cpu < sccb->ncpurl; cpue++, cpu++) {
|
|
for (cpu = 0; cpu < sccb->ncpurl; cpue++, cpu++) {
|
|
if (boot_cpu_address != cpue->core_id)
|
|
if (boot_cpu_address != cpue->core_id)
|
|
continue;
|
|
continue;
|
|
- sclp_siif = cpue->siif;
|
|
|
|
- sclp_sigpif = cpue->sigpif;
|
|
|
|
|
|
+ sclp.has_siif = cpue->siif;
|
|
|
|
+ sclp.has_sigpif = cpue->sigpif;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -151,58 +141,15 @@ static void __init sclp_facilities_detect(struct read_info_sccb *sccb)
|
|
sclp_ipl_info.has_dump = 1;
|
|
sclp_ipl_info.has_dump = 1;
|
|
memcpy(&sclp_ipl_info.loadparm, &sccb->loadparm, LOADPARM_LEN);
|
|
memcpy(&sclp_ipl_info.loadparm, &sccb->loadparm, LOADPARM_LEN);
|
|
|
|
|
|
- sclp_mtid = (sccb->fac42 & 0x80) ? (sccb->fac42 & 31) : 0;
|
|
|
|
- sclp_mtid_cp = (sccb->fac42 & 0x80) ? (sccb->fac43 & 31) : 0;
|
|
|
|
- sclp_mtid_max = max(sclp_mtid, sclp_mtid_cp);
|
|
|
|
- sclp_mtid_prev = (sccb->fac42 & 0x80) ? (sccb->fac66 & 31) : 0;
|
|
|
|
|
|
+ sclp.mtid = (sccb->fac42 & 0x80) ? (sccb->fac42 & 31) : 0;
|
|
|
|
+ sclp.mtid_cp = (sccb->fac42 & 0x80) ? (sccb->fac43 & 31) : 0;
|
|
|
|
+ sclp_mtid_max = max(sclp.mtid, sclp.mtid_cp);
|
|
|
|
+ sclp.mtid_prev = (sccb->fac42 & 0x80) ? (sccb->fac66 & 31) : 0;
|
|
}
|
|
}
|
|
|
|
|
|
-bool __init sclp_has_linemode(void)
|
|
|
|
-{
|
|
|
|
- return !!sclp_con_has_linemode;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-bool __init sclp_has_vt220(void)
|
|
|
|
-{
|
|
|
|
- return !!sclp_con_has_vt220;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-unsigned long long sclp_get_rnmax(void)
|
|
|
|
-{
|
|
|
|
- return sclp_rnmax;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-unsigned long long sclp_get_rzm(void)
|
|
|
|
-{
|
|
|
|
- return sclp_rzm;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-unsigned int sclp_get_max_cpu(void)
|
|
|
|
-{
|
|
|
|
- return sclp_max_cpu;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int sclp_has_siif(void)
|
|
|
|
-{
|
|
|
|
- return sclp_siif;
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL(sclp_has_siif);
|
|
|
|
-
|
|
|
|
-int sclp_has_sigpif(void)
|
|
|
|
-{
|
|
|
|
- return sclp_sigpif;
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL(sclp_has_sigpif);
|
|
|
|
-
|
|
|
|
-unsigned int sclp_get_ibc(void)
|
|
|
|
-{
|
|
|
|
- return sclp_ibc;
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL(sclp_get_ibc);
|
|
|
|
-
|
|
|
|
unsigned int sclp_get_mtid(u8 cpu_type)
|
|
unsigned int sclp_get_mtid(u8 cpu_type)
|
|
{
|
|
{
|
|
- return cpu_type ? sclp_mtid : sclp_mtid_cp;
|
|
|
|
|
|
+ return cpu_type ? sclp.mtid : sclp.mtid_cp;
|
|
}
|
|
}
|
|
|
|
|
|
unsigned int sclp_get_mtid_max(void)
|
|
unsigned int sclp_get_mtid_max(void)
|
|
@@ -210,11 +157,6 @@ unsigned int sclp_get_mtid_max(void)
|
|
return sclp_mtid_max;
|
|
return sclp_mtid_max;
|
|
}
|
|
}
|
|
|
|
|
|
-unsigned int sclp_get_mtid_prev(void)
|
|
|
|
-{
|
|
|
|
- return sclp_mtid_prev;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* This function will be called after sclp_facilities_detect(), which gets
|
|
* This function will be called after sclp_facilities_detect(), which gets
|
|
* called from early.c code. The sclp_facilities_detect() function retrieves
|
|
* called from early.c code. The sclp_facilities_detect() function retrieves
|
|
@@ -286,11 +228,6 @@ static long __init sclp_hsa_copy_wait(struct sccb_header *sccb)
|
|
return (((struct sdias_sccb *) sccb)->evbuf.blk_cnt - 1) * PAGE_SIZE;
|
|
return (((struct sdias_sccb *) sccb)->evbuf.blk_cnt - 1) * PAGE_SIZE;
|
|
}
|
|
}
|
|
|
|
|
|
-unsigned long sclp_get_hsa_size(void)
|
|
|
|
-{
|
|
|
|
- return sclp_hsa_size;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void __init sclp_hsa_size_detect(void *sccb)
|
|
static void __init sclp_hsa_size_detect(void *sccb)
|
|
{
|
|
{
|
|
long size;
|
|
long size;
|
|
@@ -313,7 +250,7 @@ static void __init sclp_hsa_size_detect(void *sccb)
|
|
if (size < 0)
|
|
if (size < 0)
|
|
return;
|
|
return;
|
|
out:
|
|
out:
|
|
- sclp_hsa_size = size;
|
|
|
|
|
|
+ sclp.hsa_size = size;
|
|
}
|
|
}
|
|
|
|
|
|
static unsigned int __init sclp_con_check_linemode(struct init_sccb *sccb)
|
|
static unsigned int __init sclp_con_check_linemode(struct init_sccb *sccb)
|
|
@@ -331,10 +268,10 @@ static void __init sclp_console_detect(struct init_sccb *sccb)
|
|
return;
|
|
return;
|
|
|
|
|
|
if (sccb->sclp_send_mask & EVTYP_VT220MSG_MASK)
|
|
if (sccb->sclp_send_mask & EVTYP_VT220MSG_MASK)
|
|
- sclp_con_has_vt220 = 1;
|
|
|
|
|
|
+ sclp.has_vt220 = 1;
|
|
|
|
|
|
if (sclp_con_check_linemode(sccb))
|
|
if (sclp_con_check_linemode(sccb))
|
|
- sclp_con_has_linemode = 1;
|
|
|
|
|
|
+ sclp.has_linemode = 1;
|
|
}
|
|
}
|
|
|
|
|
|
void __init sclp_early_detect(void)
|
|
void __init sclp_early_detect(void)
|