diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2007-04-27 10:01:25 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-04-27 10:01:38 -0400 |
commit | 6fc321fd7dd91f0592f37503219196835314fbb7 (patch) | |
tree | d512811f8f6761608829c8df44a55a2ada074cdc /drivers/s390 | |
parent | 29c380f5f06d0c5a320b9bb6f8987065e7b81c91 (diff) |
[S390] cio/ipl: Clean interface between cio and ipl code.
Clean interface between cio and ipl code, so Peter stops complaining.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/cio/cio.c | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 9cb129ab5be5..21af446c1f2d 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -1048,37 +1048,19 @@ void reipl_ccw_dev(struct ccw_dev_id *devid) | |||
1048 | do_reipl_asm(*((__u32*)&schid)); | 1048 | do_reipl_asm(*((__u32*)&schid)); |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | static struct schib __initdata ipl_schib; | 1051 | int __init cio_get_iplinfo(struct cio_iplinfo *iplinfo) |
1052 | |||
1053 | /* | ||
1054 | * ipl_save_parameters gets called very early. It is not allowed to access | ||
1055 | * anything in the bss section at all. The bss section is not cleared yet, | ||
1056 | * but may contain some ipl parameters written by the firmware. | ||
1057 | * These parameters (if present) are copied to 0x2000. | ||
1058 | * To avoid corruption of the ipl parameters, all variables used by this | ||
1059 | * function must reside on the stack or in the data section. | ||
1060 | */ | ||
1061 | void ipl_save_parameters(void) | ||
1062 | { | 1052 | { |
1063 | struct subchannel_id schid; | 1053 | struct subchannel_id schid; |
1064 | unsigned int *ipl_ptr; | 1054 | struct schib schib; |
1065 | void *src, *dst; | ||
1066 | 1055 | ||
1067 | schid = *(struct subchannel_id *)__LC_SUBCHANNEL_ID; | 1056 | schid = *(struct subchannel_id *)__LC_SUBCHANNEL_ID; |
1068 | if (!schid.one) | 1057 | if (!schid.one) |
1069 | return; | 1058 | return -ENODEV; |
1070 | if (stsch(schid, &ipl_schib)) | 1059 | if (stsch(schid, &schib)) |
1071 | return; | 1060 | return -ENODEV; |
1072 | if (!ipl_schib.pmcw.dnv) | 1061 | if (!schib.pmcw.dnv) |
1073 | return; | 1062 | return -ENODEV; |
1074 | ipl_devno = ipl_schib.pmcw.dev; | 1063 | iplinfo->devno = schib.pmcw.dev; |
1075 | ipl_flags |= IPL_DEVNO_VALID; | 1064 | iplinfo->is_qdio = schib.pmcw.qf; |
1076 | if (!ipl_schib.pmcw.qf) | 1065 | return 0; |
1077 | return; | ||
1078 | ipl_flags |= IPL_PARMBLOCK_VALID; | ||
1079 | ipl_ptr = (unsigned int *)__LC_IPL_PARMBLOCK_PTR; | ||
1080 | src = (void *)(unsigned long)*ipl_ptr; | ||
1081 | dst = (void *)IPL_PARMBLOCK_ORIGIN; | ||
1082 | memmove(dst, src, PAGE_SIZE); | ||
1083 | *ipl_ptr = IPL_PARMBLOCK_ORIGIN; | ||
1084 | } | 1066 | } |