Skip to content

Commit add923b

Browse files
frankjaahuth
authored andcommitted
pc-bios: s390x: Move panic() into header and add infinite loop
panic() was defined for the ccw and net bios, i.e. twice, so it's cleaner to rather put it into the header. Also let's add an infinite loop into the assembly of disabled_wait() so the caller doesn't need to take care of it. Signed-off-by: Janosch Frank <[email protected]> Reviewed-by: Pierre Morel <[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 fe75c65 commit add923b

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

pc-bios/s390-ccw/main.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ void write_iplb_location(void)
4646
lowcore->ptr_iplb = ptr2u32(&iplb);
4747
}
4848

49-
void panic(const char *string)
50-
{
51-
sclp_print(string);
52-
disabled_wait();
53-
while (1) { }
54-
}
55-
5649
unsigned int get_loadparm_index(void)
5750
{
5851
return atoui(loadparm_str);

pc-bios/s390-ccw/netmain.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,6 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_ip)
439439
return rc;
440440
}
441441

442-
void panic(const char *string)
443-
{
444-
sclp_print(string);
445-
for (;;) {
446-
disabled_wait();
447-
}
448-
}
449-
450442
void write_subsystem_identification(void)
451443
{
452444
SubChannelId *schid = (SubChannelId *) 184;

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@ typedef unsigned long long __u64;
5050
#include "iplb.h"
5151

5252
/* start.s */
53-
void disabled_wait(void);
53+
void disabled_wait(void) __attribute__ ((__noreturn__));
5454
void consume_sclp_int(void);
5555
void consume_io_int(void);
5656

5757
/* main.c */
58-
void panic(const char *string);
5958
void write_subsystem_identification(void);
6059
void write_iplb_location(void);
6160
extern char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
@@ -91,6 +90,12 @@ bool menu_is_enabled_enum(void);
9190

9291
#define MAX_BOOT_ENTRIES 31
9392

93+
static inline void panic(const char *string)
94+
{
95+
sclp_print(string);
96+
disabled_wait();
97+
}
98+
9499
static inline void fill_hex(char *out, unsigned char val)
95100
{
96101
const char hex[] = "0123456789abcdef";

pc-bios/s390-ccw/start.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ memsetxc:
4747
*/
4848
.globl disabled_wait
4949
disabled_wait:
50-
larl %r1,disabled_wait_psw
51-
lpswe 0(%r1)
50+
larl %r1,disabled_wait_psw
51+
lpswe 0(%r1)
52+
1: j 1b
5253

5354

5455
/*

0 commit comments

Comments
 (0)