Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22362a0e authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

s390/sclp: convert early sclp console code to C



The 31-bit assembler code for the early sclp console is error
prone as git commit fde24b54d976cc123506695c17db01438a11b673
"s390/sclp: clear upper register halves in _sclp_print_early"
has shown.

Convert the assembler code to C.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 1d2334cb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ mflags-$(CONFIG_MARCH_Z196) := -march=z196
mflags-$(CONFIG_MARCH_ZEC12)  := -march=zEC12
mflags-$(CONFIG_MARCH_Z13)   := -march=z13

export CC_FLAGS_MARCH := $(mflags-y)

aflags-y += $(mflags-y)
cflags-y += $(mflags-y)

+11 −0
Original line number Diff line number Diff line
@@ -232,6 +232,17 @@ static inline void __load_psw_mask (unsigned long mask)
		: "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc");
}

/*
 * Extract current PSW mask
 */
static inline unsigned long __extract_psw(void)
{
	unsigned int reg1, reg2;

	asm volatile("epsw %0,%1" : "=d" (reg1), "=a" (reg2));
	return (((unsigned long) reg1) << 32) | ((unsigned long) reg2);
}

/*
 * Rewind PSW instruction address by specified number of bytes.
 */
+1 −1
Original line number Diff line number Diff line
@@ -79,6 +79,6 @@ int sclp_pci_configure(u32 fid);
int sclp_pci_deconfigure(u32 fid);
int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode);
void sclp_early_detect(void);
long _sclp_print_early(const char *);
int _sclp_print_early(const char *);

#endif /* _ASM_S390_SCLP_H */
+11 −0
Original line number Diff line number Diff line
@@ -28,6 +28,17 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'

CFLAGS_sysinfo.o += -w

#
# Use -march=z900 for sclp.c to be able to print an error message if
# the kernel is started on a machine which is too old
#
CFLAGS_REMOVE_sclp.o = $(CC_FLAGS_FTRACE)
ifneq ($(CC_FLAGS_MARCH),-march=z900)
CFLAGS_REMOVE_sclp.o += $(CC_FLAGS_MARCH)
CFLAGS_sclp.o	+= -march=z900
endif
GCOV_PROFILE_sclp.o := n

obj-y	:= traps.o time.o process.o base.o early.o setup.o idle.o vtime.o
obj-y	+= processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o
obj-y	+= debug.o irq.o ipl.o dis.o diag.o sclp.o vdso.o
+1 −0
Original line number Diff line number Diff line
@@ -370,6 +370,7 @@ ENTRY(startup_kdump)
	xc	0x200(256),0x200	# partially clear lowcore
	xc	0x300(256),0x300
	xc	0xe00(256),0xe00
	lctlg	%c0,%c15,0x200(%r0)	# initialize control registers
	stck	__LC_LAST_UPDATE_CLOCK
	spt	6f-.LPG0(%r13)
	mvc	__LC_LAST_UPDATE_TIMER(8),6f-.LPG0(%r13)
Loading