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

Commit aa33c8cb authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

[S390] cleanup trap handling



Move the program interruption code and the translation exception identifier
to the pt_regs structure as 'int_code' and 'int_parm_long' and make the
first level interrupt handler in entry[64].S store the two values. That
makes it possible to drop 'prot_addr' and 'trap_no' from the thread_struct
and to reduce the number of arguments to a lot of functions. Finally
un-inline do_trap. Overall this saves 5812 bytes in the .text section of
the 64 bit kernel.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 679e2ea7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,6 +22,6 @@ enum die_val {
	DIE_NMI_IPI,
};

extern void die(const char *, struct pt_regs *, long);
extern void die(struct pt_regs *, const char *);

#endif
+0 −2
Original line number Diff line number Diff line
@@ -80,8 +80,6 @@ struct thread_struct {
	unsigned int  acrs[NUM_ACRS];
        unsigned long ksp;              /* kernel stack pointer             */
	mm_segment_t mm_segment;
        unsigned long prot_addr;        /* address of protection-excep.     */
        unsigned int trap_no;
	unsigned long gmap_addr;	/* address of last gmap fault. */
	struct per_regs per_user;	/* User specified PER registers */
	struct per_event per_event;	/* Cause of the last PER trap */
+2 −1
Original line number Diff line number Diff line
@@ -324,7 +324,8 @@ struct pt_regs
	psw_t psw;
	unsigned long gprs[NUM_GPRS];
	unsigned long orig_gpr2;
	unsigned int svc_code;
	unsigned int int_code;
	unsigned long int_parm_long;
};

/*
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ static inline long syscall_get_nr(struct task_struct *task,
				  struct pt_regs *regs)
{
	return test_tsk_thread_flag(task, TIF_SYSCALL) ?
		(regs->svc_code & 0xffff) : -1;
		(regs->int_code & 0xffff) : -1;
}

static inline void syscall_rollback(struct task_struct *task,
+2 −1
Original line number Diff line number Diff line
@@ -45,7 +45,8 @@ int main(void)
	DEFINE(__PT_PSW, offsetof(struct pt_regs, psw));
	DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs));
	DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2));
	DEFINE(__PT_SVC_CODE, offsetof(struct pt_regs, svc_code));
	DEFINE(__PT_INT_CODE, offsetof(struct pt_regs, int_code));
	DEFINE(__PT_INT_PARM_LONG, offsetof(struct pt_regs, int_parm_long));
	DEFINE(__PT_SIZE, sizeof(struct pt_regs));
	BLANK();
	DEFINE(__SF_BACKCHAIN, offsetof(struct stack_frame, back_chain));
Loading