Commit 7d136361 authored by Miles Bader's avatar Miles Bader Committed by Arnaldo Carvalho de Melo

[PATCH] Whitespace and comment cleanups for v850 entry.S

parent 2813d4af
...@@ -29,28 +29,28 @@ ...@@ -29,28 +29,28 @@
#define CSYM C_SYMBOL_NAME #define CSYM C_SYMBOL_NAME
/* The offset of the struct pt_regs in a `state save frame' on the stack. */ /* The offset of the struct pt_regs in a state-save-frame on the stack. */
#define PTO STATE_SAVE_PT_OFFSET #define PTO STATE_SAVE_PT_OFFSET
/* Save argument registers to the struct pt_regs pointed to by EP. */ /* Save argument registers to the state-save-frame pointed to by EP. */
#define SAVE_ARG_REGS \ #define SAVE_ARG_REGS \
sst.w r6, PTO+PT_GPR(6)[ep]; \ sst.w r6, PTO+PT_GPR(6)[ep]; \
sst.w r7, PTO+PT_GPR(7)[ep]; \ sst.w r7, PTO+PT_GPR(7)[ep]; \
sst.w r8, PTO+PT_GPR(8)[ep]; \ sst.w r8, PTO+PT_GPR(8)[ep]; \
sst.w r9, PTO+PT_GPR(9)[ep] sst.w r9, PTO+PT_GPR(9)[ep]
/* Restore argument registers from the struct pt_regs pointed to by EP. */ /* Restore argument registers from the state-save-frame pointed to by EP. */
#define RESTORE_ARG_REGS \ #define RESTORE_ARG_REGS \
sld.w PTO+PT_GPR(6)[ep], r6; \ sld.w PTO+PT_GPR(6)[ep], r6; \
sld.w PTO+PT_GPR(7)[ep], r7; \ sld.w PTO+PT_GPR(7)[ep], r7; \
sld.w PTO+PT_GPR(8)[ep], r8; \ sld.w PTO+PT_GPR(8)[ep], r8; \
sld.w PTO+PT_GPR(9)[ep], r9 sld.w PTO+PT_GPR(9)[ep], r9
/* Save value return registers to the struct pt_regs pointed to by EP. */ /* Save value return registers to the state-save-frame pointed to by EP. */
#define SAVE_RVAL_REGS \ #define SAVE_RVAL_REGS \
sst.w r10, PTO+PT_GPR(10)[ep]; \ sst.w r10, PTO+PT_GPR(10)[ep]; \
sst.w r11, PTO+PT_GPR(11)[ep] sst.w r11, PTO+PT_GPR(11)[ep]
/* Restore value return registers from the struct pt_regs pointed to by EP. */ /* Restore value return registers from the state-save-frame pointed to by EP. */
#define RESTORE_RVAL_REGS \ #define RESTORE_RVAL_REGS \
sld.w PTO+PT_GPR(10)[ep], r10; \ sld.w PTO+PT_GPR(10)[ep], r10; \
sld.w PTO+PT_GPR(11)[ep], r11 sld.w PTO+PT_GPR(11)[ep], r11
...@@ -81,13 +81,13 @@ ...@@ -81,13 +81,13 @@
sld.w PTO+PT_GPR(18)[ep], r18; \ sld.w PTO+PT_GPR(18)[ep], r18; \
sld.w PTO+PT_GPR(19)[ep], r19 sld.w PTO+PT_GPR(19)[ep], r19
/* Save `call clobbered' registers to the struct pt_regs pointed to by EP. */ /* Save `call clobbered' registers to the state-save-frame pointed to by EP. */
#define SAVE_CALL_CLOBBERED_REGS \ #define SAVE_CALL_CLOBBERED_REGS \
SAVE_CALL_CLOBBERED_REGS_BEFORE_ARGS; \ SAVE_CALL_CLOBBERED_REGS_BEFORE_ARGS; \
SAVE_ARG_REGS; \ SAVE_ARG_REGS; \
SAVE_RVAL_REGS; \ SAVE_RVAL_REGS; \
SAVE_CALL_CLOBBERED_REGS_AFTER_RVAL SAVE_CALL_CLOBBERED_REGS_AFTER_RVAL
/* Restore `call clobbered' registers from the struct pt_regs pointed to /* Restore `call clobbered' registers from the state-save-frame pointed to
by EP. */ by EP. */
#define RESTORE_CALL_CLOBBERED_REGS \ #define RESTORE_CALL_CLOBBERED_REGS \
RESTORE_CALL_CLOBBERED_REGS_BEFORE_ARGS; \ RESTORE_CALL_CLOBBERED_REGS_BEFORE_ARGS; \
...@@ -96,19 +96,19 @@ ...@@ -96,19 +96,19 @@
RESTORE_CALL_CLOBBERED_REGS_AFTER_RVAL RESTORE_CALL_CLOBBERED_REGS_AFTER_RVAL
/* Save `call clobbered' registers except for the return-value registers /* Save `call clobbered' registers except for the return-value registers
to the struct pt_regs pointed to by EP. */ to the state-save-frame pointed to by EP. */
#define SAVE_CALL_CLOBBERED_REGS_NO_RVAL \ #define SAVE_CALL_CLOBBERED_REGS_NO_RVAL \
SAVE_CALL_CLOBBERED_REGS_BEFORE_ARGS; \ SAVE_CALL_CLOBBERED_REGS_BEFORE_ARGS; \
SAVE_ARG_REGS; \ SAVE_ARG_REGS; \
SAVE_CALL_CLOBBERED_REGS_AFTER_RVAL SAVE_CALL_CLOBBERED_REGS_AFTER_RVAL
/* Restore `call clobbered' registers except for the return-value registers /* Restore `call clobbered' registers except for the return-value registers
from the struct pt_regs pointed to by EP. */ from the state-save-frame pointed to by EP. */
#define RESTORE_CALL_CLOBBERED_REGS_NO_RVAL \ #define RESTORE_CALL_CLOBBERED_REGS_NO_RVAL \
RESTORE_CALL_CLOBBERED_REGS_BEFORE_ARGS; \ RESTORE_CALL_CLOBBERED_REGS_BEFORE_ARGS; \
RESTORE_ARG_REGS; \ RESTORE_ARG_REGS; \
RESTORE_CALL_CLOBBERED_REGS_AFTER_RVAL RESTORE_CALL_CLOBBERED_REGS_AFTER_RVAL
/* Save `call saved' registers to the struct pt_regs pointed to by EP. */ /* Save `call saved' registers to the state-save-frame pointed to by EP. */
#define SAVE_CALL_SAVED_REGS \ #define SAVE_CALL_SAVED_REGS \
sst.w r2, PTO+PT_GPR(2)[ep]; \ sst.w r2, PTO+PT_GPR(2)[ep]; \
sst.w r20, PTO+PT_GPR(20)[ep]; \ sst.w r20, PTO+PT_GPR(20)[ep]; \
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
sst.w r27, PTO+PT_GPR(27)[ep]; \ sst.w r27, PTO+PT_GPR(27)[ep]; \
sst.w r28, PTO+PT_GPR(28)[ep]; \ sst.w r28, PTO+PT_GPR(28)[ep]; \
sst.w r29, PTO+PT_GPR(29)[ep] sst.w r29, PTO+PT_GPR(29)[ep]
/* Restore `call saved' registers from the struct pt_regs pointed to by EP. */ /* Restore `call saved' registers from the state-save-frame pointed to by EP. */
#define RESTORE_CALL_SAVED_REGS \ #define RESTORE_CALL_SAVED_REGS \
sld.w PTO+PT_GPR(2)[ep], r2; \ sld.w PTO+PT_GPR(2)[ep], r2; \
sld.w PTO+PT_GPR(20)[ep], r20; \ sld.w PTO+PT_GPR(20)[ep], r20; \
...@@ -136,12 +136,12 @@ ...@@ -136,12 +136,12 @@
sld.w PTO+PT_GPR(29)[ep], r29 sld.w PTO+PT_GPR(29)[ep], r29
/* Save the PC stored in the special register SAVEREG to the struct pt_regs /* Save the PC stored in the special register SAVEREG to the state-save-frame
pointed to by EP. r19 is clobbered. */ pointed to by EP. r19 is clobbered. */
#define SAVE_PC(savereg) \ #define SAVE_PC(savereg) \
stsr SR_ ## savereg, r19; \ stsr SR_ ## savereg, r19; \
sst.w r19, PTO+PT_PC[ep] sst.w r19, PTO+PT_PC[ep]
/* Restore the PC from the struct pt_regs pointed to by EP, to the special /* Restore the PC from the state-save-frame pointed to by EP, to the special
register SAVEREG. LP is clobbered (it is used as a scratch register register SAVEREG. LP is clobbered (it is used as a scratch register
because the POP_STATE macro restores it, and this macro is usually used because the POP_STATE macro restores it, and this macro is usually used
inside POP_STATE). */ inside POP_STATE). */
...@@ -149,11 +149,11 @@ ...@@ -149,11 +149,11 @@
sld.w PTO+PT_PC[ep], lp; \ sld.w PTO+PT_PC[ep], lp; \
ldsr lp, SR_ ## savereg ldsr lp, SR_ ## savereg
/* Save the PSW register stored in the special register SAVREG to the /* Save the PSW register stored in the special register SAVREG to the
struct pt_regs pointed to by EP r19 is clobbered. */ state-save-frame pointed to by EP. r19 is clobbered. */
#define SAVE_PSW(savereg) \ #define SAVE_PSW(savereg) \
stsr SR_ ## savereg, r19; \ stsr SR_ ## savereg, r19; \
sst.w r19, PTO+PT_PSW[ep] sst.w r19, PTO+PT_PSW[ep]
/* Restore the PSW register from the struct pt_regs pointed to by EP, to /* Restore the PSW register from the state-save-frame pointed to by EP, to
the special register SAVEREG. LP is clobbered (it is used as a scratch the special register SAVEREG. LP is clobbered (it is used as a scratch
register because the POP_STATE macro restores it, and this macro is register because the POP_STATE macro restores it, and this macro is
usually used inside POP_STATE). */ usually used inside POP_STATE). */
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
sld.w PTO+PT_PSW[ep], lp; \ sld.w PTO+PT_PSW[ep], lp; \
ldsr lp, SR_ ## savereg ldsr lp, SR_ ## savereg
/* Save CTPC/CTPSW/CTBP registers to the struct pt_regs pointed to by REG. /* Save CTPC/CTPSW/CTBP registers to the state-save-frame pointed to by REG.
r19 is clobbered. */ r19 is clobbered. */
#define SAVE_CT_REGS \ #define SAVE_CT_REGS \
stsr SR_CTPC, r19; \ stsr SR_CTPC, r19; \
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
sst.w r19, PTO+PT_CTPSW[ep]; \ sst.w r19, PTO+PT_CTPSW[ep]; \
stsr SR_CTBP, r19; \ stsr SR_CTBP, r19; \
sst.w r19, PTO+PT_CTBP[ep] sst.w r19, PTO+PT_CTBP[ep]
/* Restore CTPC/CTPSW/CTBP registers from the struct pt_regs pointed to by EP. /* Restore CTPC/CTPSW/CTBP registers from the state-save-frame pointed to by EP.
LP is clobbered (it is used as a scratch register because the POP_STATE LP is clobbered (it is used as a scratch register because the POP_STATE
macro restores it, and this macro is usually used inside POP_STATE). */ macro restores it, and this macro is usually used inside POP_STATE). */
#define RESTORE_CT_REGS \ #define RESTORE_CT_REGS \
...@@ -182,10 +182,11 @@ ...@@ -182,10 +182,11 @@
ldsr lp, SR_CTBP ldsr lp, SR_CTBP
/* Push register state, except for the stack pointer, on the stack in the form /* Push register state, except for the stack pointer, on the stack in the
of a struct pt_regs, in preparation for a system call. This macro makes form of a state-save-frame (plus some extra padding), in preparation for
sure that `special' registers, system registers; TYPE identifies the set of a system call. This macro makes sure that the EP, GP, and LP
extra registers to be saved as well. EP is clobbered. */ registers are saved, and TYPE identifies the set of extra registers to
be saved as well. Also copies (the new value of) SP to EP. */
#define PUSH_STATE(type) \ #define PUSH_STATE(type) \
addi -STATE_SAVE_SIZE, sp, sp; /* Make room on the stack. */ \ addi -STATE_SAVE_SIZE, sp, sp; /* Make room on the stack. */ \
st.w ep, PTO+PT_GPR(GPR_EP)[sp]; \ st.w ep, PTO+PT_GPR(GPR_EP)[sp]; \
...@@ -193,8 +194,8 @@ ...@@ -193,8 +194,8 @@
sst.w gp, PTO+PT_GPR(GPR_GP)[ep]; \ sst.w gp, PTO+PT_GPR(GPR_GP)[ep]; \
sst.w lp, PTO+PT_GPR(GPR_LP)[ep]; \ sst.w lp, PTO+PT_GPR(GPR_LP)[ep]; \
type ## _STATE_SAVER type ## _STATE_SAVER
/* Pop a register state, except for the stack pointer, from the struct pt_regs /* Pop a register state pushed by PUSH_STATE, except for the stack pointer,
on the stack. */ from the the stack. */
#define POP_STATE(type) \ #define POP_STATE(type) \
mov sp, ep; \ mov sp, ep; \
type ## _STATE_RESTORER; \ type ## _STATE_RESTORER; \
...@@ -205,7 +206,7 @@ ...@@ -205,7 +206,7 @@
/* Switch to the kernel stack if necessary, and push register state on the /* Switch to the kernel stack if necessary, and push register state on the
stack in the form of a struct pt_regs. Also load the current task stack in the form of a state-save-frame. Also load the current task
pointer if switching from user mode. The stack-pointer (r3) should have pointer if switching from user mode. The stack-pointer (r3) should have
already been saved to the memory location SP_SAVE_LOC (the reason for already been saved to the memory location SP_SAVE_LOC (the reason for
this is that the interrupt vectors may be beyond a 22-bit signed offset this is that the interrupt vectors may be beyond a 22-bit signed offset
...@@ -311,8 +312,8 @@ ...@@ -311,8 +312,8 @@
#define IRQ_EXTRA_STATE_RESTORER \ #define IRQ_EXTRA_STATE_RESTORER \
RESTORE_CALL_SAVED_REGS; \ RESTORE_CALL_SAVED_REGS; \
RESTORE_CT_REGS RESTORE_CT_REGS
#define IRQ_FUNCALL_EXTRA_STATE_SAVER /* nothing */ #define IRQ_SCHEDULE_EXTRA_STATE_SAVER /* nothing */
#define IRQ_FUNCALL_EXTRA_STATE_RESTORER /* nothing */ #define IRQ_SCHEDULE_EXTRA_STATE_RESTORER /* nothing */
/* Register saving/restoring for non-maskable interrupts. */ /* Register saving/restoring for non-maskable interrupts. */
#define NMI_RET reti #define NMI_RET reti
...@@ -330,8 +331,8 @@ ...@@ -330,8 +331,8 @@
#define NMI_EXTRA_STATE_RESTORER \ #define NMI_EXTRA_STATE_RESTORER \
RESTORE_CALL_SAVED_REGS; \ RESTORE_CALL_SAVED_REGS; \
RESTORE_CT_REGS RESTORE_CT_REGS
#define NMI_FUNCALL_EXTRA_STATE_SAVER /* nothing */ #define NMI_SCHEDULE_EXTRA_STATE_SAVER /* nothing */
#define NMI_FUNCALL_EXTRA_STATE_RESTORER /* nothing */ #define NMI_SCHEDULE_EXTRA_STATE_RESTORER /* nothing */
/* Register saving/restoring for debug traps. */ /* Register saving/restoring for debug traps. */
#define DBTRAP_RET .long 0x014607E0 /* `dbret', but gas doesn't support it. */ #define DBTRAP_RET .long 0x014607E0 /* `dbret', but gas doesn't support it. */
...@@ -349,8 +350,8 @@ ...@@ -349,8 +350,8 @@
#define DBTRAP_EXTRA_STATE_RESTORER \ #define DBTRAP_EXTRA_STATE_RESTORER \
RESTORE_CALL_SAVED_REGS; \ RESTORE_CALL_SAVED_REGS; \
RESTORE_CT_REGS RESTORE_CT_REGS
#define DBTRAP_FUNCALL_EXTRA_STATE_SAVER /* nothing */ #define DBTRAP_SCHEDULE_EXTRA_STATE_SAVER /* nothing */
#define DBTRAP_FUNCALL_EXTRA_STATE_RESTORER /* nothing */ #define DBTRAP_SCHEDULE_EXTRA_STATE_RESTORER /* nothing */
/* Register saving/restoring for a context switch. We don't need to save /* Register saving/restoring for a context switch. We don't need to save
too many registers, because context-switching looks like a function call too many registers, because context-switching looks like a function call
...@@ -372,7 +373,7 @@ ...@@ -372,7 +373,7 @@
RESTORE_CT_REGS RESTORE_CT_REGS
/* Restore register state from the struct pt_regs on the stack, switch back /* Restore register state from the state-save-frame on the stack, switch back
to the user stack if necessary, and return from the trap/interrupt. to the user stack if necessary, and return from the trap/interrupt.
EXTRA_STATE_RESTORER is a sequence of assembly language statements to EXTRA_STATE_RESTORER is a sequence of assembly language statements to
restore anything not restored by this macro. Only registers not saved by restore anything not restored by this macro. Only registers not saved by
...@@ -505,6 +506,7 @@ L_ENTRY(ret_from_trap): ...@@ -505,6 +506,7 @@ L_ENTRY(ret_from_trap):
RETURN(TRAP) RETURN(TRAP)
END(ret_from_trap) END(ret_from_trap)
/* This the initial entry point for a new child thread, with an appropriate /* This the initial entry point for a new child thread, with an appropriate
stack in place that makes it look the the child is in the middle of an stack in place that makes it look the the child is in the middle of an
syscall. This function is actually `returned to' from switch_thread syscall. This function is actually `returned to' from switch_thread
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment