There's a convenient macro for 'SS+8' called FRAME_SIZE. Use it to clarify things. (entry/calling.h calls this SIZEOF_PTREGS but we're using asm/ptrace-abi.h)
Unified · Split
| @@ -23,7 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #endif /* CONFIG_FRAME_POINTER */ |
| 24 | 24 | |
| 25 | 25 | /* Size of stack used to save mcount regs in save_mcount_regs */ |
| 26 | −#define MCOUNT_REG_SIZE (SS+8 + MCOUNT_FRAME_SIZE) | |
| 26 | +#define MCOUNT_REG_SIZE (FRAME_SIZE + MCOUNT_FRAME_SIZE) | |
| 27 | 27 | |
| 28 | 28 | /* |
| 29 | 29 | * gcc -pg option adds a call to 'mcount' in most functions. |
| @@ -77,7 +77,7 @@ · 47 unmodified lines | ||
| 77 | 77 | /* |
| 78 | 78 | * We add enough stack to save all regs. |
| 79 | 79 | */ |
| 80 | − subq $(MCOUNT_REG_SIZE - MCOUNT_FRAME_SIZE), %rsp | |
| 80 | + subq $(FRAME_SIZE), %rsp | |
| 81 | 81 | movq %rax, RAX(%rsp) |
| 82 | 82 | movq %rcx, RCX(%rsp) |
| 83 | 83 | movq %rdx, RDX(%rsp) |