diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-07-14 03:59:21 -0400 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-07-14 04:02:17 -0400 |
commit | 23d1742179170b69e61ac9166248ffd64857e55a (patch) | |
tree | 5afb9b76b666f1543a6e8c42d760dfe0454e62e7 /drivers/s390/char | |
parent | ef60cd13ecee0ccf2439d63013cbfc798aea2bb9 (diff) |
[S390] Move memory detection code to own file.
Move memory detection code to own file and also simplify it.
Also add an interface which can be called at any time to get the
current memory layout. This interface is needed by our kernel
internal system dumper.
Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Cc: Michael Holzheu <holzheu@de.ibm.com>
Cc: Frank Munzert <munzert@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char')
-rw-r--r-- | drivers/s390/char/sclp_cmd.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index 4f45884c92c3..0c2b77493db4 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c | |||
@@ -67,7 +67,7 @@ out: | |||
67 | return rc; | 67 | return rc; |
68 | } | 68 | } |
69 | 69 | ||
70 | void __init sclp_read_info_early(void) | 70 | static void __init sclp_read_info_early(void) |
71 | { | 71 | { |
72 | int rc; | 72 | int rc; |
73 | int i; | 73 | int i; |
@@ -97,30 +97,33 @@ void __init sclp_read_info_early(void) | |||
97 | 97 | ||
98 | void __init sclp_facilities_detect(void) | 98 | void __init sclp_facilities_detect(void) |
99 | { | 99 | { |
100 | if (!early_read_info_sccb_valid) | ||
101 | return; | ||
102 | sclp_facilities = early_read_info_sccb.facilities; | ||
103 | sclp_fac84 = early_read_info_sccb.fac84; | ||
104 | } | ||
105 | |||
106 | unsigned long long __init sclp_memory_detect(void) | ||
107 | { | ||
108 | unsigned long long memsize; | ||
109 | struct read_info_sccb *sccb; | 100 | struct read_info_sccb *sccb; |
110 | 101 | ||
102 | sclp_read_info_early(); | ||
111 | if (!early_read_info_sccb_valid) | 103 | if (!early_read_info_sccb_valid) |
112 | return 0; | 104 | return; |
105 | |||
113 | sccb = &early_read_info_sccb; | 106 | sccb = &early_read_info_sccb; |
107 | sclp_facilities = sccb->facilities; | ||
108 | sclp_fac84 = sccb->fac84; | ||
114 | rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2; | 109 | rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2; |
115 | rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2; | 110 | rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2; |
116 | rzm <<= 20; | 111 | rzm <<= 20; |
117 | memsize = rzm * rnmax; | 112 | } |
118 | return memsize; | 113 | |
114 | unsigned long long sclp_get_rnmax(void) | ||
115 | { | ||
116 | return rnmax; | ||
117 | } | ||
118 | |||
119 | unsigned long long sclp_get_rzm(void) | ||
120 | { | ||
121 | return rzm; | ||
119 | } | 122 | } |
120 | 123 | ||
121 | /* | 124 | /* |
122 | * This function will be called after sclp_memory_detect(), which gets called | 125 | * This function will be called after sclp_facilities_detect(), which gets |
123 | * early from early.c code. Therefore the sccb should have valid contents. | 126 | * called from early.c code. Therefore the sccb should have valid contents. |
124 | */ | 127 | */ |
125 | void __init sclp_get_ipl_info(struct sclp_ipl_info *info) | 128 | void __init sclp_get_ipl_info(struct sclp_ipl_info *info) |
126 | { | 129 | { |