Skip to content

Commit

Permalink
powerpc: Separate out load/store emulation into its own function
Browse files Browse the repository at this point in the history
This moves the parts of emulate_step() that deal with emulating
load and store instructions into a new function called
emulate_loadstore().  This is to make it possible to reuse this
code in the alignment handler.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Paul Mackerras authored and Michael Ellerman committed Sep 1, 2017
1 parent d955189 commit a53d518
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 113 deletions.
9 changes: 9 additions & 0 deletions arch/powerpc/include/asm/sstep.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ void emulate_update_regs(struct pt_regs *reg, struct instruction_op *op);
*/
extern int emulate_step(struct pt_regs *regs, unsigned int instr);

/*
* Emulate a load or store instruction by reading/writing the
* memory of the current process. FP/VMX/VSX registers are assumed
* to hold live values if the appropriate enable bit in regs->msr is
* set; otherwise this will use the saved values in the thread struct
* for user-mode accesses.
*/
extern int emulate_loadstore(struct pt_regs *regs, struct instruction_op *op);

extern void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
const void *mem, bool cross_endian);
extern void emulate_vsx_store(struct instruction_op *op,
Expand Down
Loading

0 comments on commit a53d518

Please sign in to comment.