Skip to content

Commit fe75c65

Browse files
frankjaahuth
authored andcommitted
pc-bios: s390x: Use PSW masks where possible and introduce PSW_MASK_SHORT_ADDR
Let's move some of the PSW mask defines into s390-arch.h and use them in jump2ipl.c. Also let's introduce a new constant for the address mask of 8 byte (short) PSWs. Signed-off-by: Janosch Frank <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Message-Id: <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent b88faa1 commit fe75c65

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pc-bios/s390-ccw/jump2ipl.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88

99
#include "libc.h"
1010
#include "s390-ccw.h"
11+
#include "s390-arch.h"
1112

1213
#define KERN_IMAGE_START 0x010000UL
13-
#define PSW_MASK_64 0x0000000100000000ULL
14-
#define PSW_MASK_32 0x0000000080000000ULL
15-
#define PSW_MASK_SHORTPSW 0x0008000000000000ULL
16-
#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_32 | PSW_MASK_64)
14+
#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_64)
1715

1816
typedef struct ResetInfo {
1917
uint64_t ipl_psw;
@@ -54,7 +52,7 @@ void jump_to_IPL_code(uint64_t address)
5452

5553
current->ipl_psw = (uint64_t) &jump_to_IPL_2;
5654
current->ipl_psw |= RESET_PSW_MASK;
57-
current->ipl_continue = address & 0x7fffffff;
55+
current->ipl_continue = address & PSW_MASK_SHORT_ADDR;
5856

5957
debug_print_int("set IPL addr to", current->ipl_continue);
6058

@@ -86,7 +84,7 @@ void jump_to_low_kernel(void)
8684

8785
/* Trying to get PSW at zero address */
8886
if (*((uint64_t *)0) & RESET_PSW_MASK) {
89-
jump_to_IPL_code((*((uint64_t *)0)) & 0x7fffffff);
87+
jump_to_IPL_code((*((uint64_t *)0)) & PSW_MASK_SHORT_ADDR);
9088
}
9189

9290
/* No other option left, so use the Linux kernel start address */

pc-bios/s390-ccw/s390-arch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ _Static_assert(sizeof(struct PSWLegacy) == 8, "PSWLegacy size incorrect");
2626

2727
/* s390 psw bit masks */
2828
#define PSW_MASK_IOINT 0x0200000000000000ULL
29+
#define PSW_MASK_SHORTPSW 0x0008000000000000ULL
2930
#define PSW_MASK_WAIT 0x0002000000000000ULL
3031
#define PSW_MASK_EAMODE 0x0000000100000000ULL
3132
#define PSW_MASK_BAMODE 0x0000000080000000ULL
33+
#define PSW_MASK_SHORT_ADDR 0x000000007fffffffULL
3234
#define PSW_MASK_64 (PSW_MASK_EAMODE | PSW_MASK_BAMODE)
3335

3436
/* Low core mapping */

0 commit comments

Comments
 (0)