Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313656
b: refs/heads/master
c: 44ce6a5
h: refs/heads/master
v: v3
  • Loading branch information
Michael Neuling authored and Benjamin Herrenschmidt committed Jul 10, 2012
1 parent cd5c7ee commit 9293eae
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 115 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4404a9f98f0d426907a926c094a2dfbaa17b796d
refs/heads/master: 44ce6a5ee751893ecdedbd7544c645752a5dbc01
5 changes: 5 additions & 0 deletions trunk/arch/powerpc/include/asm/ppc_asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
#ifdef __KERNEL__
#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 GLUE(a,b) XGLUE(a,b)

Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/powerpc/lib/checksum_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ _GLOBAL(csum_tcpudp_magic)
srwi r3,r3,16
blr

#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)

/*
* Computes the checksum of a memory block at buff, length len,
* and adds in "sum" (32-bit).
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/powerpc/lib/copypage_power7.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#include <asm/page.h>
#include <asm/ppc_asm.h>

#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)

_GLOBAL(copypage_power7)
/*
* We prefetch both the source and destination using enhanced touch
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/powerpc/lib/copyuser_power7.S
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
*/
#include <asm/ppc_asm.h>

#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)

.macro err1
100:
.section __ex_table,"a"
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/powerpc/lib/memcpy_power7.S
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
*/
#include <asm/ppc_asm.h>

#define STACKFRAMESIZE 256
#define STK_REG(i) (112 + ((i)-14)*8)

_GLOBAL(memcpy_power7)
#ifdef CONFIG_ALTIVEC
cmpldi r5,16
Expand Down
88 changes: 40 additions & 48 deletions trunk/arch/powerpc/mm/hash_low_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@
* | CR save area (SP + 8)
* 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

Expand All @@ -64,9 +56,9 @@ _GLOBAL(__hash_page_4K)
std r0,16(r1)
stdu r1,-STACKFRAMESIZE(r1)
/* Save all params that we need after a function call */
std r6,STK_PARM(R6)(r1)
std r8,STK_PARM(R8)(r1)
std r9,STK_PARM(R9)(r1)
std r6,STK_PARAM(R6)(r1)
std r8,STK_PARAM(R8)(r1)
std r9,STK_PARAM(R9)(r1)

/* Save non-volatile registers.
* r31 will hold "old PTE"
Expand Down Expand Up @@ -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
* place of "access" in the param area (sic)
*/
std r3,STK_PARM(R4)(r1)
std r3,STK_PARAM(R4)(r1)

/* Get htab_hash_mask */
ld r4,htab_hash_mask@got(2)
Expand Down Expand Up @@ -192,11 +184,11 @@ htab_insert_pte:
rldicr r3,r0,3,63-3 /* r3 = (hash & mask) << 3 */

/* 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 */
li r7,0 /* !bolted, !secondary */
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)
bl . /* Patched by htab_finish_init() */
cmpdi 0,r3,0
Expand All @@ -215,11 +207,11 @@ _GLOBAL(htab_call_hpte_insert1)
rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */

/* 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 */
li r7,HPTE_V_SECONDARY /* !bolted, secondary */
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)
bl . /* Patched by htab_finish_init() */
cmpdi 0,r3,0
Expand Down Expand Up @@ -255,7 +247,7 @@ htab_pte_insert_ok:
* (maybe add eieio may be good still ?)
*/
htab_write_out_pte:
ld r6,STK_PARM(R6)(r1)
ld r6,STK_PARAM(R6)(r1)
std r30,0(r6)
li r3, 0
htab_bail:
Expand Down Expand Up @@ -288,8 +280,8 @@ htab_modify_pte:
/* Call ppc_md.hpte_updatepp */
mr r5,r29 /* va */
li r6,MMU_PAGE_4K /* page size */
ld r7,STK_PARM(R9)(r1) /* segment size */
ld r8,STK_PARM(R8)(r1) /* get "local" param */
ld r7,STK_PARAM(R9)(r1) /* segment size */
ld r8,STK_PARAM(R8)(r1) /* get "local" param */
_GLOBAL(htab_call_hpte_updatepp)
bl . /* Patched by htab_finish_init() */

Expand All @@ -312,7 +304,7 @@ htab_wrong_access:

htab_pte_insert_failure:
/* Bail out restoring old PTE */
ld r6,STK_PARM(R6)(r1)
ld r6,STK_PARAM(R6)(r1)
std r31,0(r6)
li r3,-1
b htab_bail
Expand Down Expand Up @@ -340,9 +332,9 @@ _GLOBAL(__hash_page_4K)
std r0,16(r1)
stdu r1,-STACKFRAMESIZE(r1)
/* Save all params that we need after a function call */
std r6,STK_PARM(R6)(r1)
std r8,STK_PARM(R8)(r1)
std r9,STK_PARM(R9)(r1)
std r6,STK_PARAM(R6)(r1)
std r8,STK_PARAM(R8)(r1)
std r9,STK_PARAM(R9)(r1)

/* Save non-volatile registers.
* r31 will hold "old PTE"
Expand Down Expand Up @@ -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
* place of "access" in the param area (sic)
*/
std r3,STK_PARM(R4)(r1)
std r3,STK_PARAM(R4)(r1)

/* Get htab_hash_mask */
ld r4,htab_hash_mask@got(2)
Expand All @@ -473,7 +465,7 @@ END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
andis. r0,r31,_PAGE_COMBO@h
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 */
ld r26,0(r26)
addi r5,r25,36 /* Check actual HPTE_SUB bit, this */
Expand All @@ -495,11 +487,11 @@ htab_special_pfn:
rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */

/* 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 */
li r7,0 /* !bolted, !secondary */
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)
bl . /* patched by htab_finish_init() */
cmpdi 0,r3,0
Expand All @@ -522,11 +514,11 @@ _GLOBAL(htab_call_hpte_insert1)
rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */

/* 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 */
li r7,HPTE_V_SECONDARY /* !bolted, secondary */
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)
bl . /* patched by htab_finish_init() */
cmpdi 0,r3,0
Expand Down Expand Up @@ -559,8 +551,8 @@ htab_inval_old_hpte:
mr r4,r31 /* PTE.pte */
li r5,0 /* PTE.hidx */
li r6,MMU_PAGE_64K /* psize */
ld r7,STK_PARM(R9)(r1) /* ssize */
ld r8,STK_PARM(R8)(r1) /* local */
ld r7,STK_PARAM(R9)(r1) /* ssize */
ld r8,STK_PARAM(R8)(r1) /* local */
bl .flush_hash_page
/* Clear out _PAGE_HPTE_SUB bits in the new linux PTE */
lis r0,_PAGE_HPTE_SUB@h
Expand All @@ -576,7 +568,7 @@ htab_pte_insert_ok:
/* Insert slot number & secondary bit in PTE second half,
* 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
andc r30,r30,r0
/* HPTE SUB bit */
Expand Down Expand Up @@ -630,8 +622,8 @@ htab_modify_pte:
/* Call ppc_md.hpte_updatepp */
mr r5,r29 /* va */
li r6,MMU_PAGE_4K /* page size */
ld r7,STK_PARM(R9)(r1) /* segment size */
ld r8,STK_PARM(R8)(r1) /* get "local" param */
ld r7,STK_PARAM(R9)(r1) /* segment size */
ld r8,STK_PARAM(R8)(r1) /* get "local" param */
_GLOBAL(htab_call_hpte_updatepp)
bl . /* patched by htab_finish_init() */

Expand All @@ -644,7 +636,7 @@ _GLOBAL(htab_call_hpte_updatepp)
/* Clear the BUSY bit and Write out the PTE */
li r0,_PAGE_BUSY
andc r30,r30,r0
ld r6,STK_PARM(R6)(r1)
ld r6,STK_PARAM(R6)(r1)
std r30,0(r6)
li r3,0
b htab_bail
Expand All @@ -657,7 +649,7 @@ htab_wrong_access:

htab_pte_insert_failure:
/* Bail out restoring old PTE */
ld r6,STK_PARM(R6)(r1)
ld r6,STK_PARAM(R6)(r1)
std r31,0(r6)
li r3,-1
b htab_bail
Expand All @@ -677,9 +669,9 @@ _GLOBAL(__hash_page_64K)
std r0,16(r1)
stdu r1,-STACKFRAMESIZE(r1)
/* Save all params that we need after a function call */
std r6,STK_PARM(R6)(r1)
std r8,STK_PARM(R8)(r1)
std r9,STK_PARM(R9)(r1)
std r6,STK_PARAM(R6)(r1)
std r8,STK_PARAM(R8)(r1)
std r9,STK_PARAM(R9)(r1)

/* Save non-volatile registers.
* r31 will hold "old PTE"
Expand Down Expand Up @@ -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
* place of "access" in the param area (sic)
*/
std r3,STK_PARM(R4)(r1)
std r3,STK_PARAM(R4)(r1)

/* Get htab_hash_mask */
ld r4,htab_hash_mask@got(2)
Expand Down Expand Up @@ -813,11 +805,11 @@ ht64_insert_pte:
rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */

/* 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 */
li r7,0 /* !bolted, !secondary */
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)
bl . /* patched by htab_finish_init() */
cmpdi 0,r3,0
Expand All @@ -836,11 +828,11 @@ _GLOBAL(ht64_call_hpte_insert1)
rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */

/* 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 */
li r7,HPTE_V_SECONDARY /* !bolted, secondary */
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)
bl . /* patched by htab_finish_init() */
cmpdi 0,r3,0
Expand Down Expand Up @@ -876,7 +868,7 @@ ht64_pte_insert_ok:
* (maybe add eieio may be good still ?)
*/
ht64_write_out_pte:
ld r6,STK_PARM(R6)(r1)
ld r6,STK_PARAM(R6)(r1)
std r30,0(r6)
li r3, 0
ht64_bail:
Expand Down Expand Up @@ -909,8 +901,8 @@ ht64_modify_pte:
/* Call ppc_md.hpte_updatepp */
mr r5,r29 /* va */
li r6,MMU_PAGE_64K
ld r7,STK_PARM(R9)(r1) /* segment size */
ld r8,STK_PARM(R8)(r1) /* get "local" param */
ld r7,STK_PARAM(R9)(r1) /* segment size */
ld r8,STK_PARAM(R8)(r1) /* get "local" param */
_GLOBAL(ht64_call_hpte_updatepp)
bl . /* patched by htab_finish_init() */

Expand All @@ -933,7 +925,7 @@ ht64_wrong_access:

ht64_pte_insert_failure:
/* Bail out restoring old PTE */
ld r6,STK_PARM(R6)(r1)
ld r6,STK_PARAM(R6)(r1)
std r31,0(r6)
li r3,-1
b ht64_bail
Expand Down
Loading

0 comments on commit 9293eae

Please sign in to comment.