提交 44ce6a5e 编写于 作者: M Michael Neuling 提交者: Benjamin Herrenschmidt

powerpc: Merge STK_REG/PARAM/FRAMESIZE

Merge the defines of STACKFRAMESIZE, STK_REG, STK_PARAM from different
places.
Signed-off-by: NMichael Neuling <mikey@neuling.org>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 4404a9f9
...@@ -181,6 +181,11 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) ...@@ -181,6 +181,11 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)
#define STK_PARAM(i) (48 + ((i)-3)*8)
#define XGLUE(a,b) a##b #define XGLUE(a,b) a##b
#define GLUE(a,b) XGLUE(a,b) #define GLUE(a,b) XGLUE(a,b)
......
...@@ -65,9 +65,6 @@ _GLOBAL(csum_tcpudp_magic) ...@@ -65,9 +65,6 @@ _GLOBAL(csum_tcpudp_magic)
srwi r3,r3,16 srwi r3,r3,16
blr blr
#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)
/* /*
* Computes the checksum of a memory block at buff, length len, * Computes the checksum of a memory block at buff, length len,
* and adds in "sum" (32-bit). * and adds in "sum" (32-bit).
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/ppc_asm.h> #include <asm/ppc_asm.h>
#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)
_GLOBAL(copypage_power7) _GLOBAL(copypage_power7)
/* /*
* We prefetch both the source and destination using enhanced touch * We prefetch both the source and destination using enhanced touch
......
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
*/ */
#include <asm/ppc_asm.h> #include <asm/ppc_asm.h>
#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)
.macro err1 .macro err1
100: 100:
.section __ex_table,"a" .section __ex_table,"a"
......
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
*/ */
#include <asm/ppc_asm.h> #include <asm/ppc_asm.h>
#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)
_GLOBAL(memcpy_power7) _GLOBAL(memcpy_power7)
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
cmpldi r5,16 cmpldi r5,16
......
...@@ -34,14 +34,6 @@ ...@@ -34,14 +34,6 @@
* | CR save area (SP + 8) * | CR save area (SP + 8)
* SP ---> +-- Back chain (SP + 0) * SP ---> +-- Back chain (SP + 0)
*/ */
#define STACKFRAMESIZE 256
/* Save parameters offsets */
#define STK_PARM(i) (STACKFRAMESIZE + 48 + ((i)-3)*8)
/* Save non-volatile offsets */
#define STK_REG(i) (112 + ((i)-14)*8)
#ifndef CONFIG_PPC_64K_PAGES #ifndef CONFIG_PPC_64K_PAGES
...@@ -64,9 +56,9 @@ _GLOBAL(__hash_page_4K) ...@@ -64,9 +56,9 @@ _GLOBAL(__hash_page_4K)
std r0,16(r1) std r0,16(r1)
stdu r1,-STACKFRAMESIZE(r1) stdu r1,-STACKFRAMESIZE(r1)
/* Save all params that we need after a function call */ /* Save all params that we need after a function call */
std r6,STK_PARM(R6)(r1) std r6,STK_PARAM(R6)(r1)
std r8,STK_PARM(R8)(r1) std r8,STK_PARAM(R8)(r1)
std r9,STK_PARM(R9)(r1) std r9,STK_PARAM(R9)(r1)
/* Save non-volatile registers. /* Save non-volatile registers.
* r31 will hold "old PTE" * r31 will hold "old PTE"
...@@ -162,7 +154,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE) ...@@ -162,7 +154,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
/* At this point, r3 contains new PP bits, save them in /* At this point, r3 contains new PP bits, save them in
* place of "access" in the param area (sic) * place of "access" in the param area (sic)
*/ */
std r3,STK_PARM(R4)(r1) std r3,STK_PARAM(R4)(r1)
/* Get htab_hash_mask */ /* Get htab_hash_mask */
ld r4,htab_hash_mask@got(2) ld r4,htab_hash_mask@got(2)
...@@ -192,11 +184,11 @@ htab_insert_pte: ...@@ -192,11 +184,11 @@ htab_insert_pte:
rldicr r3,r0,3,63-3 /* r3 = (hash & mask) << 3 */ rldicr r3,r0,3,63-3 /* r3 = (hash & mask) << 3 */
/* Call ppc_md.hpte_insert */ /* Call ppc_md.hpte_insert */
ld r6,STK_PARM(R4)(r1) /* Retrieve new pp bits */ ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */
mr r4,r29 /* Retrieve va */ mr r4,r29 /* Retrieve va */
li r7,0 /* !bolted, !secondary */ li r7,0 /* !bolted, !secondary */
li r8,MMU_PAGE_4K /* page size */ li r8,MMU_PAGE_4K /* page size */
ld r9,STK_PARM(R9)(r1) /* segment size */ ld r9,STK_PARAM(R9)(r1) /* segment size */
_GLOBAL(htab_call_hpte_insert1) _GLOBAL(htab_call_hpte_insert1)
bl . /* Patched by htab_finish_init() */ bl . /* Patched by htab_finish_init() */
cmpdi 0,r3,0 cmpdi 0,r3,0
...@@ -215,11 +207,11 @@ _GLOBAL(htab_call_hpte_insert1) ...@@ -215,11 +207,11 @@ _GLOBAL(htab_call_hpte_insert1)
rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */ rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
/* Call ppc_md.hpte_insert */ /* Call ppc_md.hpte_insert */
ld r6,STK_PARM(R4)(r1) /* Retrieve new pp bits */ ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */
mr r4,r29 /* Retrieve va */ mr r4,r29 /* Retrieve va */
li r7,HPTE_V_SECONDARY /* !bolted, secondary */ li r7,HPTE_V_SECONDARY /* !bolted, secondary */
li r8,MMU_PAGE_4K /* page size */ li r8,MMU_PAGE_4K /* page size */
ld r9,STK_PARM(R9)(r1) /* segment size */ ld r9,STK_PARAM(R9)(r1) /* segment size */
_GLOBAL(htab_call_hpte_insert2) _GLOBAL(htab_call_hpte_insert2)
bl . /* Patched by htab_finish_init() */ bl . /* Patched by htab_finish_init() */
cmpdi 0,r3,0 cmpdi 0,r3,0
...@@ -255,7 +247,7 @@ htab_pte_insert_ok: ...@@ -255,7 +247,7 @@ htab_pte_insert_ok:
* (maybe add eieio may be good still ?) * (maybe add eieio may be good still ?)
*/ */
htab_write_out_pte: htab_write_out_pte:
ld r6,STK_PARM(R6)(r1) ld r6,STK_PARAM(R6)(r1)
std r30,0(r6) std r30,0(r6)
li r3, 0 li r3, 0
htab_bail: htab_bail:
...@@ -288,8 +280,8 @@ htab_modify_pte: ...@@ -288,8 +280,8 @@ htab_modify_pte:
/* Call ppc_md.hpte_updatepp */ /* Call ppc_md.hpte_updatepp */
mr r5,r29 /* va */ mr r5,r29 /* va */
li r6,MMU_PAGE_4K /* page size */ li r6,MMU_PAGE_4K /* page size */
ld r7,STK_PARM(R9)(r1) /* segment size */ ld r7,STK_PARAM(R9)(r1) /* segment size */
ld r8,STK_PARM(R8)(r1) /* get "local" param */ ld r8,STK_PARAM(R8)(r1) /* get "local" param */
_GLOBAL(htab_call_hpte_updatepp) _GLOBAL(htab_call_hpte_updatepp)
bl . /* Patched by htab_finish_init() */ bl . /* Patched by htab_finish_init() */
...@@ -312,7 +304,7 @@ htab_wrong_access: ...@@ -312,7 +304,7 @@ htab_wrong_access:
htab_pte_insert_failure: htab_pte_insert_failure:
/* Bail out restoring old PTE */ /* Bail out restoring old PTE */
ld r6,STK_PARM(R6)(r1) ld r6,STK_PARAM(R6)(r1)
std r31,0(r6) std r31,0(r6)
li r3,-1 li r3,-1
b htab_bail b htab_bail
...@@ -340,9 +332,9 @@ _GLOBAL(__hash_page_4K) ...@@ -340,9 +332,9 @@ _GLOBAL(__hash_page_4K)
std r0,16(r1) std r0,16(r1)
stdu r1,-STACKFRAMESIZE(r1) stdu r1,-STACKFRAMESIZE(r1)
/* Save all params that we need after a function call */ /* Save all params that we need after a function call */
std r6,STK_PARM(R6)(r1) std r6,STK_PARAM(R6)(r1)
std r8,STK_PARM(R8)(r1) std r8,STK_PARAM(R8)(r1)
std r9,STK_PARM(R9)(r1) std r9,STK_PARAM(R9)(r1)
/* Save non-volatile registers. /* Save non-volatile registers.
* r31 will hold "old PTE" * r31 will hold "old PTE"
...@@ -452,7 +444,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE) ...@@ -452,7 +444,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
/* At this point, r3 contains new PP bits, save them in /* At this point, r3 contains new PP bits, save them in
* place of "access" in the param area (sic) * place of "access" in the param area (sic)
*/ */
std r3,STK_PARM(R4)(r1) std r3,STK_PARAM(R4)(r1)
/* Get htab_hash_mask */ /* Get htab_hash_mask */
ld r4,htab_hash_mask@got(2) ld r4,htab_hash_mask@got(2)
...@@ -473,7 +465,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE) ...@@ -473,7 +465,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
andis. r0,r31,_PAGE_COMBO@h andis. r0,r31,_PAGE_COMBO@h
beq htab_inval_old_hpte beq htab_inval_old_hpte
ld r6,STK_PARM(R6)(r1) ld r6,STK_PARAM(R6)(r1)
ori r26,r6,0x8000 /* Load the hidx mask */ ori r26,r6,0x8000 /* Load the hidx mask */
ld r26,0(r26) ld r26,0(r26)
addi r5,r25,36 /* Check actual HPTE_SUB bit, this */ addi r5,r25,36 /* Check actual HPTE_SUB bit, this */
...@@ -495,11 +487,11 @@ htab_special_pfn: ...@@ -495,11 +487,11 @@ htab_special_pfn:
rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
/* Call ppc_md.hpte_insert */ /* Call ppc_md.hpte_insert */
ld r6,STK_PARM(R4)(r1) /* Retrieve new pp bits */ ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */
mr r4,r29 /* Retrieve va */ mr r4,r29 /* Retrieve va */
li r7,0 /* !bolted, !secondary */ li r7,0 /* !bolted, !secondary */
li r8,MMU_PAGE_4K /* page size */ li r8,MMU_PAGE_4K /* page size */
ld r9,STK_PARM(R9)(r1) /* segment size */ ld r9,STK_PARAM(R9)(r1) /* segment size */
_GLOBAL(htab_call_hpte_insert1) _GLOBAL(htab_call_hpte_insert1)
bl . /* patched by htab_finish_init() */ bl . /* patched by htab_finish_init() */
cmpdi 0,r3,0 cmpdi 0,r3,0
...@@ -522,11 +514,11 @@ _GLOBAL(htab_call_hpte_insert1) ...@@ -522,11 +514,11 @@ _GLOBAL(htab_call_hpte_insert1)
rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */ rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
/* Call ppc_md.hpte_insert */ /* Call ppc_md.hpte_insert */
ld r6,STK_PARM(R4)(r1) /* Retrieve new pp bits */ ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */
mr r4,r29 /* Retrieve va */ mr r4,r29 /* Retrieve va */
li r7,HPTE_V_SECONDARY /* !bolted, secondary */ li r7,HPTE_V_SECONDARY /* !bolted, secondary */
li r8,MMU_PAGE_4K /* page size */ li r8,MMU_PAGE_4K /* page size */
ld r9,STK_PARM(R9)(r1) /* segment size */ ld r9,STK_PARAM(R9)(r1) /* segment size */
_GLOBAL(htab_call_hpte_insert2) _GLOBAL(htab_call_hpte_insert2)
bl . /* patched by htab_finish_init() */ bl . /* patched by htab_finish_init() */
cmpdi 0,r3,0 cmpdi 0,r3,0
...@@ -559,8 +551,8 @@ htab_inval_old_hpte: ...@@ -559,8 +551,8 @@ htab_inval_old_hpte:
mr r4,r31 /* PTE.pte */ mr r4,r31 /* PTE.pte */
li r5,0 /* PTE.hidx */ li r5,0 /* PTE.hidx */
li r6,MMU_PAGE_64K /* psize */ li r6,MMU_PAGE_64K /* psize */
ld r7,STK_PARM(R9)(r1) /* ssize */ ld r7,STK_PARAM(R9)(r1) /* ssize */
ld r8,STK_PARM(R8)(r1) /* local */ ld r8,STK_PARAM(R8)(r1) /* local */
bl .flush_hash_page bl .flush_hash_page
/* Clear out _PAGE_HPTE_SUB bits in the new linux PTE */ /* Clear out _PAGE_HPTE_SUB bits in the new linux PTE */
lis r0,_PAGE_HPTE_SUB@h lis r0,_PAGE_HPTE_SUB@h
...@@ -576,7 +568,7 @@ htab_pte_insert_ok: ...@@ -576,7 +568,7 @@ htab_pte_insert_ok:
/* Insert slot number & secondary bit in PTE second half, /* Insert slot number & secondary bit in PTE second half,
* clear _PAGE_BUSY and set approriate HPTE slot bit * clear _PAGE_BUSY and set approriate HPTE slot bit
*/ */
ld r6,STK_PARM(R6)(r1) ld r6,STK_PARAM(R6)(r1)
li r0,_PAGE_BUSY li r0,_PAGE_BUSY
andc r30,r30,r0 andc r30,r30,r0
/* HPTE SUB bit */ /* HPTE SUB bit */
...@@ -630,8 +622,8 @@ htab_modify_pte: ...@@ -630,8 +622,8 @@ htab_modify_pte:
/* Call ppc_md.hpte_updatepp */ /* Call ppc_md.hpte_updatepp */
mr r5,r29 /* va */ mr r5,r29 /* va */
li r6,MMU_PAGE_4K /* page size */ li r6,MMU_PAGE_4K /* page size */
ld r7,STK_PARM(R9)(r1) /* segment size */ ld r7,STK_PARAM(R9)(r1) /* segment size */
ld r8,STK_PARM(R8)(r1) /* get "local" param */ ld r8,STK_PARAM(R8)(r1) /* get "local" param */
_GLOBAL(htab_call_hpte_updatepp) _GLOBAL(htab_call_hpte_updatepp)
bl . /* patched by htab_finish_init() */ bl . /* patched by htab_finish_init() */
...@@ -644,7 +636,7 @@ _GLOBAL(htab_call_hpte_updatepp) ...@@ -644,7 +636,7 @@ _GLOBAL(htab_call_hpte_updatepp)
/* Clear the BUSY bit and Write out the PTE */ /* Clear the BUSY bit and Write out the PTE */
li r0,_PAGE_BUSY li r0,_PAGE_BUSY
andc r30,r30,r0 andc r30,r30,r0
ld r6,STK_PARM(R6)(r1) ld r6,STK_PARAM(R6)(r1)
std r30,0(r6) std r30,0(r6)
li r3,0 li r3,0
b htab_bail b htab_bail
...@@ -657,7 +649,7 @@ htab_wrong_access: ...@@ -657,7 +649,7 @@ htab_wrong_access:
htab_pte_insert_failure: htab_pte_insert_failure:
/* Bail out restoring old PTE */ /* Bail out restoring old PTE */
ld r6,STK_PARM(R6)(r1) ld r6,STK_PARAM(R6)(r1)
std r31,0(r6) std r31,0(r6)
li r3,-1 li r3,-1
b htab_bail b htab_bail
...@@ -677,9 +669,9 @@ _GLOBAL(__hash_page_64K) ...@@ -677,9 +669,9 @@ _GLOBAL(__hash_page_64K)
std r0,16(r1) std r0,16(r1)
stdu r1,-STACKFRAMESIZE(r1) stdu r1,-STACKFRAMESIZE(r1)
/* Save all params that we need after a function call */ /* Save all params that we need after a function call */
std r6,STK_PARM(R6)(r1) std r6,STK_PARAM(R6)(r1)
std r8,STK_PARM(R8)(r1) std r8,STK_PARAM(R8)(r1)
std r9,STK_PARM(R9)(r1) std r9,STK_PARAM(R9)(r1)
/* Save non-volatile registers. /* Save non-volatile registers.
* r31 will hold "old PTE" * r31 will hold "old PTE"
...@@ -780,7 +772,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE) ...@@ -780,7 +772,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
/* At this point, r3 contains new PP bits, save them in /* At this point, r3 contains new PP bits, save them in
* place of "access" in the param area (sic) * place of "access" in the param area (sic)
*/ */
std r3,STK_PARM(R4)(r1) std r3,STK_PARAM(R4)(r1)
/* Get htab_hash_mask */ /* Get htab_hash_mask */
ld r4,htab_hash_mask@got(2) ld r4,htab_hash_mask@got(2)
...@@ -813,11 +805,11 @@ ht64_insert_pte: ...@@ -813,11 +805,11 @@ ht64_insert_pte:
rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
/* Call ppc_md.hpte_insert */ /* Call ppc_md.hpte_insert */
ld r6,STK_PARM(R4)(r1) /* Retrieve new pp bits */ ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */
mr r4,r29 /* Retrieve va */ mr r4,r29 /* Retrieve va */
li r7,0 /* !bolted, !secondary */ li r7,0 /* !bolted, !secondary */
li r8,MMU_PAGE_64K li r8,MMU_PAGE_64K
ld r9,STK_PARM(R9)(r1) /* segment size */ ld r9,STK_PARAM(R9)(r1) /* segment size */
_GLOBAL(ht64_call_hpte_insert1) _GLOBAL(ht64_call_hpte_insert1)
bl . /* patched by htab_finish_init() */ bl . /* patched by htab_finish_init() */
cmpdi 0,r3,0 cmpdi 0,r3,0
...@@ -836,11 +828,11 @@ _GLOBAL(ht64_call_hpte_insert1) ...@@ -836,11 +828,11 @@ _GLOBAL(ht64_call_hpte_insert1)
rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */ rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
/* Call ppc_md.hpte_insert */ /* Call ppc_md.hpte_insert */
ld r6,STK_PARM(R4)(r1) /* Retrieve new pp bits */ ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */
mr r4,r29 /* Retrieve va */ mr r4,r29 /* Retrieve va */
li r7,HPTE_V_SECONDARY /* !bolted, secondary */ li r7,HPTE_V_SECONDARY /* !bolted, secondary */
li r8,MMU_PAGE_64K li r8,MMU_PAGE_64K
ld r9,STK_PARM(R9)(r1) /* segment size */ ld r9,STK_PARAM(R9)(r1) /* segment size */
_GLOBAL(ht64_call_hpte_insert2) _GLOBAL(ht64_call_hpte_insert2)
bl . /* patched by htab_finish_init() */ bl . /* patched by htab_finish_init() */
cmpdi 0,r3,0 cmpdi 0,r3,0
...@@ -876,7 +868,7 @@ ht64_pte_insert_ok: ...@@ -876,7 +868,7 @@ ht64_pte_insert_ok:
* (maybe add eieio may be good still ?) * (maybe add eieio may be good still ?)
*/ */
ht64_write_out_pte: ht64_write_out_pte:
ld r6,STK_PARM(R6)(r1) ld r6,STK_PARAM(R6)(r1)
std r30,0(r6) std r30,0(r6)
li r3, 0 li r3, 0
ht64_bail: ht64_bail:
...@@ -909,8 +901,8 @@ ht64_modify_pte: ...@@ -909,8 +901,8 @@ ht64_modify_pte:
/* Call ppc_md.hpte_updatepp */ /* Call ppc_md.hpte_updatepp */
mr r5,r29 /* va */ mr r5,r29 /* va */
li r6,MMU_PAGE_64K li r6,MMU_PAGE_64K
ld r7,STK_PARM(R9)(r1) /* segment size */ ld r7,STK_PARAM(R9)(r1) /* segment size */
ld r8,STK_PARM(R8)(r1) /* get "local" param */ ld r8,STK_PARAM(R8)(r1) /* get "local" param */
_GLOBAL(ht64_call_hpte_updatepp) _GLOBAL(ht64_call_hpte_updatepp)
bl . /* patched by htab_finish_init() */ bl . /* patched by htab_finish_init() */
...@@ -933,7 +925,7 @@ ht64_wrong_access: ...@@ -933,7 +925,7 @@ ht64_wrong_access:
ht64_pte_insert_failure: ht64_pte_insert_failure:
/* Bail out restoring old PTE */ /* Bail out restoring old PTE */
ld r6,STK_PARM(R6)(r1) ld r6,STK_PARAM(R6)(r1)
std r31,0(r6) std r31,0(r6)
li r3,-1 li r3,-1
b ht64_bail b ht64_bail
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include <asm/ppc_asm.h> #include <asm/ppc_asm.h>
#define STK_PARM(i) (48 + ((i)-3)*8)
/* Not implemented on Beat, now */ /* Not implemented on Beat, now */
#define HCALL_INST_PRECALL #define HCALL_INST_PRECALL
#define HCALL_INST_POSTCALL #define HCALL_INST_POSTCALL
...@@ -74,7 +72,7 @@ _GLOBAL(beat_hcall_norets8) ...@@ -74,7 +72,7 @@ _GLOBAL(beat_hcall_norets8)
mr r6,r7 mr r6,r7
mr r7,r8 mr r7,r8
mr r8,r9 mr r8,r9
ld r10,STK_PARM(R10)(r1) ld r10,STK_PARAM(R10)(r1)
HVSC /* invoke the hypervisor */ HVSC /* invoke the hypervisor */
...@@ -94,7 +92,7 @@ _GLOBAL(beat_hcall1) ...@@ -94,7 +92,7 @@ _GLOBAL(beat_hcall1)
HCALL_INST_PRECALL HCALL_INST_PRECALL
std r4,STK_PARM(R4)(r1) /* save ret buffer */ std r4,STK_PARAM(R4)(r1) /* save ret buffer */
mr r11,r3 mr r11,r3
mr r3,r5 mr r3,r5
...@@ -108,7 +106,7 @@ _GLOBAL(beat_hcall1) ...@@ -108,7 +106,7 @@ _GLOBAL(beat_hcall1)
HCALL_INST_POSTCALL HCALL_INST_POSTCALL
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
lwz r0,8(r1) lwz r0,8(r1)
...@@ -125,7 +123,7 @@ _GLOBAL(beat_hcall2) ...@@ -125,7 +123,7 @@ _GLOBAL(beat_hcall2)
HCALL_INST_PRECALL HCALL_INST_PRECALL
std r4,STK_PARM(R4)(r1) /* save ret buffer */ std r4,STK_PARAM(R4)(r1) /* save ret buffer */
mr r11,r3 mr r11,r3
mr r3,r5 mr r3,r5
...@@ -139,7 +137,7 @@ _GLOBAL(beat_hcall2) ...@@ -139,7 +137,7 @@ _GLOBAL(beat_hcall2)
HCALL_INST_POSTCALL HCALL_INST_POSTCALL
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
...@@ -157,7 +155,7 @@ _GLOBAL(beat_hcall3) ...@@ -157,7 +155,7 @@ _GLOBAL(beat_hcall3)
HCALL_INST_PRECALL HCALL_INST_PRECALL
std r4,STK_PARM(R4)(r1) /* save ret buffer */ std r4,STK_PARAM(R4)(r1) /* save ret buffer */
mr r11,r3 mr r11,r3
mr r3,r5 mr r3,r5
...@@ -171,7 +169,7 @@ _GLOBAL(beat_hcall3) ...@@ -171,7 +169,7 @@ _GLOBAL(beat_hcall3)
HCALL_INST_POSTCALL HCALL_INST_POSTCALL
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
std r6, 16(r12) std r6, 16(r12)
...@@ -190,7 +188,7 @@ _GLOBAL(beat_hcall4) ...@@ -190,7 +188,7 @@ _GLOBAL(beat_hcall4)
HCALL_INST_PRECALL HCALL_INST_PRECALL
std r4,STK_PARM(R4)(r1) /* save ret buffer */ std r4,STK_PARAM(R4)(r1) /* save ret buffer */
mr r11,r3 mr r11,r3
mr r3,r5 mr r3,r5
...@@ -204,7 +202,7 @@ _GLOBAL(beat_hcall4) ...@@ -204,7 +202,7 @@ _GLOBAL(beat_hcall4)
HCALL_INST_POSTCALL HCALL_INST_POSTCALL
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
std r6, 16(r12) std r6, 16(r12)
...@@ -224,7 +222,7 @@ _GLOBAL(beat_hcall5) ...@@ -224,7 +222,7 @@ _GLOBAL(beat_hcall5)
HCALL_INST_PRECALL HCALL_INST_PRECALL
std r4,STK_PARM(R4)(r1) /* save ret buffer */ std r4,STK_PARAM(R4)(r1) /* save ret buffer */
mr r11,r3 mr r11,r3
mr r3,r5 mr r3,r5
...@@ -238,7 +236,7 @@ _GLOBAL(beat_hcall5) ...@@ -238,7 +236,7 @@ _GLOBAL(beat_hcall5)
HCALL_INST_POSTCALL HCALL_INST_POSTCALL
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
std r6, 16(r12) std r6, 16(r12)
...@@ -259,7 +257,7 @@ _GLOBAL(beat_hcall6) ...@@ -259,7 +257,7 @@ _GLOBAL(beat_hcall6)
HCALL_INST_PRECALL HCALL_INST_PRECALL
std r4,STK_PARM(R4)(r1) /* save ret buffer */ std r4,STK_PARAM(R4)(r1) /* save ret buffer */
mr r11,r3 mr r11,r3
mr r3,r5 mr r3,r5
...@@ -273,7 +271,7 @@ _GLOBAL(beat_hcall6) ...@@ -273,7 +271,7 @@ _GLOBAL(beat_hcall6)
HCALL_INST_POSTCALL HCALL_INST_POSTCALL
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
std r6, 16(r12) std r6, 16(r12)
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/opal.h> #include <asm/opal.h>
#define STK_PARAM(i) (48 + ((i)-3)*8)
#define H_HAL_TAKEOVER 0x5124 #define H_HAL_TAKEOVER 0x5124
#define H_HAL_TAKEOVER_QUERY_MAGIC -1 #define H_HAL_TAKEOVER_QUERY_MAGIC -1
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#define STK_PARM(i) (48 + ((i)-3)*8)
#ifdef CONFIG_TRACEPOINTS #ifdef CONFIG_TRACEPOINTS
.section ".toc","aw" .section ".toc","aw"
...@@ -26,7 +24,7 @@ hcall_tracepoint_refcount: ...@@ -26,7 +24,7 @@ hcall_tracepoint_refcount:
.section ".text" .section ".text"
/* /*
* precall must preserve all registers. use unused STK_PARM() * precall must preserve all registers. use unused STK_PARAM()
* areas to save snapshots and opcode. We branch around this * areas to save snapshots and opcode. We branch around this
* in early init (eg when populating the MMU hashtable) by using an * in early init (eg when populating the MMU hashtable) by using an
* unconditional cpu feature. * unconditional cpu feature.
...@@ -40,28 +38,28 @@ END_FTR_SECTION(0, 1); \ ...@@ -40,28 +38,28 @@ END_FTR_SECTION(0, 1); \
cmpdi r12,0; \ cmpdi r12,0; \
beq+ 1f; \ beq+ 1f; \
mflr r0; \ mflr r0; \
std r3,STK_PARM(R3)(r1); \ std r3,STK_PARAM(R3)(r1); \
std r4,STK_PARM(R4)(r1); \ std r4,STK_PARAM(R4)(r1); \
std r5,STK_PARM(R5)(r1); \ std r5,STK_PARAM(R5)(r1); \
std r6,STK_PARM(R6)(r1); \ std r6,STK_PARAM(R6)(r1); \
std r7,STK_PARM(R7)(r1); \ std r7,STK_PARAM(R7)(r1); \
std r8,STK_PARM(R8)(r1); \ std r8,STK_PARAM(R8)(r1); \
std r9,STK_PARM(R9)(r1); \ std r9,STK_PARAM(R9)(r1); \
std r10,STK_PARM(R10)(r1); \ std r10,STK_PARAM(R10)(r1); \
std r0,16(r1); \ std r0,16(r1); \
addi r4,r1,STK_PARM(FIRST_REG); \ addi r4,r1,STK_PARAM(FIRST_REG); \
stdu r1,-STACK_FRAME_OVERHEAD(r1); \ stdu r1,-STACK_FRAME_OVERHEAD(r1); \
bl .__trace_hcall_entry; \ bl .__trace_hcall_entry; \
addi r1,r1,STACK_FRAME_OVERHEAD; \ addi r1,r1,STACK_FRAME_OVERHEAD; \
ld r0,16(r1); \ ld r0,16(r1); \
ld r3,STK_PARM(R3)(r1); \ ld r3,STK_PARAM(R3)(r1); \
ld r4,STK_PARM(R4)(r1); \ ld r4,STK_PARAM(R4)(r1); \
ld r5,STK_PARM(R5)(r1); \ ld r5,STK_PARAM(R5)(r1); \
ld r6,STK_PARM(R6)(r1); \ ld r6,STK_PARAM(R6)(r1); \
ld r7,STK_PARM(R7)(r1); \ ld r7,STK_PARAM(R7)(r1); \
ld r8,STK_PARM(R8)(r1); \ ld r8,STK_PARAM(R8)(r1); \
ld r9,STK_PARM(R9)(r1); \ ld r9,STK_PARAM(R9)(r1); \
ld r10,STK_PARM(R10)(r1); \ ld r10,STK_PARAM(R10)(r1); \
mtlr r0; \ mtlr r0; \
1: 1:
...@@ -79,8 +77,8 @@ END_FTR_SECTION(0, 1); \ ...@@ -79,8 +77,8 @@ END_FTR_SECTION(0, 1); \
cmpdi r12,0; \ cmpdi r12,0; \
beq+ 1f; \ beq+ 1f; \
mflr r0; \ mflr r0; \
ld r6,STK_PARM(R3)(r1); \ ld r6,STK_PARAM(R3)(r1); \
std r3,STK_PARM(R3)(r1); \ std r3,STK_PARAM(R3)(r1); \
mr r4,r3; \ mr r4,r3; \
mr r3,r6; \ mr r3,r6; \
std r0,16(r1); \ std r0,16(r1); \
...@@ -88,7 +86,7 @@ END_FTR_SECTION(0, 1); \ ...@@ -88,7 +86,7 @@ END_FTR_SECTION(0, 1); \
bl .__trace_hcall_exit; \ bl .__trace_hcall_exit; \
addi r1,r1,STACK_FRAME_OVERHEAD; \ addi r1,r1,STACK_FRAME_OVERHEAD; \
ld r0,16(r1); \ ld r0,16(r1); \
ld r3,STK_PARM(R3)(r1); \ ld r3,STK_PARAM(R3)(r1); \
mtlr r0; \ mtlr r0; \
1: 1:
...@@ -132,7 +130,7 @@ _GLOBAL(plpar_hcall) ...@@ -132,7 +130,7 @@ _GLOBAL(plpar_hcall)
HCALL_INST_PRECALL(R5) HCALL_INST_PRECALL(R5)
std r4,STK_PARM(R4)(r1) /* Save ret buffer */ std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
...@@ -143,7 +141,7 @@ _GLOBAL(plpar_hcall) ...@@ -143,7 +141,7 @@ _GLOBAL(plpar_hcall)
HVSC /* invoke the hypervisor */ HVSC /* invoke the hypervisor */
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
std r6, 16(r12) std r6, 16(r12)
...@@ -168,7 +166,7 @@ _GLOBAL(plpar_hcall_raw) ...@@ -168,7 +166,7 @@ _GLOBAL(plpar_hcall_raw)
mfcr r0 mfcr r0
stw r0,8(r1) stw r0,8(r1)
std r4,STK_PARM(R4)(r1) /* Save ret buffer */ std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
...@@ -179,7 +177,7 @@ _GLOBAL(plpar_hcall_raw) ...@@ -179,7 +177,7 @@ _GLOBAL(plpar_hcall_raw)
HVSC /* invoke the hypervisor */ HVSC /* invoke the hypervisor */
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
std r6, 16(r12) std r6, 16(r12)
...@@ -198,7 +196,7 @@ _GLOBAL(plpar_hcall9) ...@@ -198,7 +196,7 @@ _GLOBAL(plpar_hcall9)
HCALL_INST_PRECALL(R5) HCALL_INST_PRECALL(R5)
std r4,STK_PARM(R4)(r1) /* Save ret buffer */ std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
...@@ -206,14 +204,14 @@ _GLOBAL(plpar_hcall9) ...@@ -206,14 +204,14 @@ _GLOBAL(plpar_hcall9)
mr r7,r8 mr r7,r8
mr r8,r9 mr r8,r9
mr r9,r10 mr r9,r10
ld r10,STK_PARM(R11)(r1) /* put arg7 in R10 */ ld r10,STK_PARAM(R11)(r1) /* put arg7 in R10 */
ld r11,STK_PARM(R12)(r1) /* put arg8 in R11 */ ld r11,STK_PARAM(R12)(r1) /* put arg8 in R11 */
ld r12,STK_PARM(R13)(r1) /* put arg9 in R12 */ ld r12,STK_PARAM(R13)(r1) /* put arg9 in R12 */
HVSC /* invoke the hypervisor */ HVSC /* invoke the hypervisor */
mr r0,r12 mr r0,r12
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
std r6, 16(r12) std r6, 16(r12)
...@@ -238,7 +236,7 @@ _GLOBAL(plpar_hcall9_raw) ...@@ -238,7 +236,7 @@ _GLOBAL(plpar_hcall9_raw)
mfcr r0 mfcr r0
stw r0,8(r1) stw r0,8(r1)
std r4,STK_PARM(R4)(r1) /* Save ret buffer */ std r4,STK_PARAM(R4)(r1) /* Save ret buffer */
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
...@@ -246,14 +244,14 @@ _GLOBAL(plpar_hcall9_raw) ...@@ -246,14 +244,14 @@ _GLOBAL(plpar_hcall9_raw)
mr r7,r8 mr r7,r8
mr r8,r9 mr r8,r9
mr r9,r10 mr r9,r10
ld r10,STK_PARM(R11)(r1) /* put arg7 in R10 */ ld r10,STK_PARAM(R11)(r1) /* put arg7 in R10 */
ld r11,STK_PARM(R12)(r1) /* put arg8 in R11 */ ld r11,STK_PARAM(R12)(r1) /* put arg8 in R11 */
ld r12,STK_PARM(R13)(r1) /* put arg9 in R12 */ ld r12,STK_PARAM(R13)(r1) /* put arg9 in R12 */
HVSC /* invoke the hypervisor */ HVSC /* invoke the hypervisor */
mr r0,r12 mr r0,r12
ld r12,STK_PARM(R4)(r1) ld r12,STK_PARAM(R4)(r1)
std r4, 0(r12) std r4, 0(r12)
std r5, 8(r12) std r5, 8(r12)
std r6, 16(r12) std r6, 16(r12)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册